'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
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
2 matches
Mail list logo