One more note:
>> Is there any way in which I can "force" a2 to being "interpreted" as >> having class "array" rather than "matrix" so that foo will work on >> a2??? > Maybe try? a3 <- structure(1:10, dim = c(2,5), class = "array") Then class(a3) gives "array", and is.matrix and is.array are both still TRUE. Erik ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.