Re: [R] Length as fun.aggregate in cast function of reshape package: unexpected error

2010-03-12 Thread jim holtman
'length' does not have an argument 'na.rm=TRUE' that you are trying to pass to it. If you want to remove NAs from the 'length' result, you would write your own function usning na.omit: > x <- c(1,2,3,NA,4,5,NA,6) > length(x) [1] 8 > length(na.omit(x)) [1] 6 > cast(testdata, ~., function(x) length

[R] Length as fun.aggregate in cast function of reshape package: unexpected error

2010-03-12 Thread David Wyllie
Dear Everyone, I am having problems with use of the reshape package's cast function using length as an aggregating function. Unexpectedly, I receive the error: 2 arguments passed to 'length' which requires 1 I don't understand this at all - the data I'm using is very simple, and appears almost