Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在几个矩阵上应用一个函数,输出应该是列表或向量,报告每个操作的结果。所以我的尝试是使用 mapply 并且看起来像这样:
myfunction<-function(x){cor(df1,x) output.list<-mapply(myfunction(df2,df3))
但这没有成功。有任何想法吗??
试试这个lapply(list(df2, df3), myfunction)。
lapply(list(df2, df3), myfunction)