在R中是否有类似以下形式的函数:
具有与以下功能相同的功能:
谢谢您的提前帮助。
crossApply(v1, v2, func)
具有与以下功能相同的功能:
ret = c()
i = 1
for (e1 in v1) {
for (e2 in v2) {
ret[i] <- func(e1,e2)
i <- i + 1
}
}
return(ret)
谢谢您的提前帮助。
emulatesum<-function(x,y) return(x + y)
是一个函数,然后rs <- outer(1:4,-(5:7),"emulatesum")
。顺便说一句:我强烈建议在 R 中使用英语,特别是对于错误信息:当你用英语时,谷歌搜索会更容易... - Nick Sabbe