我需要用R写一个函数,因为在c++这样的其他语言中,它的工作非常慢。该函数用数据填充2d表,然后汇总每一行的值以供进一步处理。
发布于 2018-02-18 11:32:00
我不确定它是否回答了您的问题,但是如果您使用数据,您可以将它们放入数据帧中,以查看统计参数并进行进一步处理。例如:
df = data.frame("var1" = c(5,10,15), "var2" = c(20,40,60))
#the 'summary' command gives you some statistical parameters based on the column
summary(df)
#with the 'apply' command you can addresses the rows.
#in this example you get the mean of each row:
apply(df, 1,mean)https://stackoverflow.com/questions/48850746
复制相似问题