我试图用我在PHP中工作的程序来计算账单余额。 我用来提取价格的代码就是这样。
> library("MASS", lib.loc="C:/Program Files/R/R-3.2.2/library")
Error in get(method, envir = home) :
lazy-load database 'C:/Program Files/R/R-3.2.2/library/MASS/R/MASS.rdb' is corrupt
In addition: Warning messages:
1: package ‘MASS’ was built under R version 3.2.5
2: In get(method, envir = home) : internal error -3 in R_decompress1
Error: package or namespace load failed for ‘MASS’
> library(MASS)
Error in get(method, envir = home) :
lazy-load database 'C:/Program Files/R/R-3.2.2/library/MASS/R/MASS.rdb' is corrupt
In addition: Warning messages:
1: package ‘MASS’ was built under R version 3.2.5
2: In .registerS3method(fin[i, 1], fin[i, 2], fin[i, 3], fin[i, 4], :
restarting interrupted promise evaluation
3: In get(method, envir = home) :
restarting interrupted promise evaluation
4: In get(method, envir = home) : internal error -3 in R_decompress1
Error: package or namespace load failed for ‘MASS’
在右侧,您可以看到结算总额,而不是将其全部单独给予我。
答案 0 :(得分:1)
错误似乎很明显。用不同的词语表达你的序列:
您看到的不是以某种方式添加为字符串的2个价格。您只需打印2种不同的价格。 10& 30
GetPricing应该返回一个价格,并且调用它的foreach循环应该是总和。
$total = 0;
foreach($resource as $row)
{
$total += self::GetPricing($row['packageID']);
}
希望这有帮助。