Re: [R] Error when using median as aggregation function in dcast

2013-06-26 Thread arun
Hi, Please check this link: http://stackoverflow.com/questions/4835202/error-with-custom-aggregate-function-for-a-cast-call-in-r-reshape2 A.K. - Original Message - From: Johannes Radinger To: R help Cc: Sent: Wednesday, June 26, 2013 4:36 AM Subject: [R] Error when using median as

[R] Error when using median as aggregation function in dcast

2013-06-26 Thread Johannes Radinger
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 =