The following code seems to contain an inconsistency in the behavior of vapply(). Am I missing something here?
## This function assumes v is a 3d vector, beta a scalar. f3d <- function(v,beta) { v+beta } ## This expression applies f3d to a vector of scalars, and ## specifies the template 'array(10,3)' for the return value. dat <- vapply(seq(0,1,length=10), function(beta) { f3d(c(0,0,0), beta) }, array(10,3)) dim(dat) # 3 10 (the dimensions are the reverse of the template?) Of course, a transpose will patch the result to match the specified template. ______________________________________________ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel