Hello!
Does apply() not work with customized functions? Here is a simple example:
AddSeven<-function(n){n+7}
AddSeven(3)
[1] 10
M<-matrix(nrow=2,ncol=2,data=c(1,2,3,4),byrow=TRUE)
M
[,1] [,2]
[1,] 1 2
[2,] 3 4
apply(x=M,margin=c(1,2),fun=AddSeven)
Error in match.fun(FUN) : argument "FUN" is missing, with no
default
Thanks for your help!
-Steve Pfeiffer
[[alternative HTML version deleted]]