[R] Reshape with var as fun.aggregate

From: <locklin.jason_at_gmail.com>
Date: Wed, 26 Nov 2008 14:05:19 -0500


I used to be able to use variance for fun.aggregate, but since I upgraded from R 2.6 to 2.7 (Ubuntu hardy to intrepid), it no longer works.

> library("reshape")
> data("french_fries")
> ffm <- melt(french_fries, id=1:4, na.rm = TRUE)
> cast(ffm, rep ~ treatment, length)

  rep 1 2 3
1 1 579 578 575
2 2 580 579 580
> cast(ffm, rep ~ treatment, mean)

  rep 1 2 3
1 1 3.207772 3.177336 3.024522
2 2 3.181207 3.115544 3.277759
> cast(ffm, rep ~ treatment, var)

Error in fun.aggregate(data$value[0]) : 'x' is empty

Any ideas?



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Wed 26 Nov 2008 - 19:11:08 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 27 Nov 2008 - 01:30:28 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive