Displaying 1 result from an estimated 1 matches for "my_median".
Did you mean:
day_median
2013 Jun 26
1
Error when using median as aggregation function in dcast
Hi,
I am trying to calculated various summary statistics using the dcast
function
of reshape2. This works perfectly for getting the mean, sum, length, sd. But
when I want to calculate the median I get an error. I tried it with and
without removing
NAs:
my_median <- function(x) median(x, na.rm = FALSE)
median_df <- dcast(patch_stats_dfm,formula=species~input+barriers,my_median)
Error in vapply(indices, fun, .default) : values must be type 'integer',
but FUN(X[[1]]) result is type 'double'
What does this error mean and what is causin...