我'尝试导出打印到.csv的数据,但无法确定相应的语法/代码。
$this->validate($request, [
'cameraMac' => 'required|transformUpper'
]);
我可以使用命令for (project in 1:ncol(df)){
i=1
for (digs in c(df[, project])){
total[i,project] = getTotalDigsCost(digs)
i = i +1
}
}
data.frame(average = sapply(total, mean),
sd = sapply(total, sd),
p95 = sapply(total, function(x) quantile(x,.95)),
p20 = sapply(total, function(x) quantile(x,.20)),
p80 = sapply(total, function(x) quantile(x,.80)))
write_csv(total, "1_R_DigsCostOutput.csv")
导出write_csv(total, 1"1_R-DigsCostOutput.csv")
,但我无法识别要导出total
,sd
等值的内容
思想?
答案 0 :(得分:0)
感谢Bugle先生和Andrew在上述评论中的帮助,我找到了导出数据框的解决方案:
write_csv(data.frame(average = sapply(total, mean),
sd = sapply(total, sd),
p95 = sapply(total,function(x) quantile(x,.95)),
p20 = sapply(total, function(x) quantile(x,.20)),
p80 = sapply(total, function(x) quantile(x,.80))),"1_R_Digs.csv")