timh at insightful.com
2008-Mar-06 17:45 UTC
[Rd] apply(x, 2, mean) fails if x is a data frame containing a matrix (PR#10902)
> data <- data.frame(a=1:5, b=I(matrix(6:15,5))) > apply(data, 2, mean)Error in dim(newX) <- c(prod(d.call), d2) : dims [product 10] do not match the length of object [15] --please do not edit the information below-- Version: platform = i386-pc-mingw32 arch = i386 os = mingw32 system = i386, mingw32 status = major = 2 minor = 6.2 year = 2008 month = 02 day = 08 svn rev = 44383 language = R version.string = R version 2.6.2 (2008-02-08) Windows XP (build 2600) Service Pack 2 Locale: LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252 Search Path: .GlobalEnv, package:stats, package:graphics, package:grDevices, package:utils, package:datasets, package:methods, Autoloads, package:base