[R] Aggregate issues with subset
jrkrideau at yahoo.ca
Thu Oct 2 15:18:41 CEST 2008
I don't have R on this machine to check but are you sure that sc_recov still exists in s.all?
Otherwise do str(s.all) and see what the object looks like.
--- On Wed, 10/1/08, Michael Just <mgjust at gmail.com> wrote:
> From: Michael Just <mgjust at gmail.com>
> Subject: [R] Aggregate issues with subset
> To: "r-help at r-project.org" <r-help at r-project.org>
> Received: Wednesday, October 1, 2008, 6:28 PM
> I used the aggregate function with success on my data frame
> > aggregate(all, list(sc_recov), mean)
> I then made a subset of this data frame:
> >s.all <-subset(all, select=
> but when I tried to to run the aggregate function on this
> > aggregate(s.all, list(sc_recov), mean)
> The result is garbage (i.e. its not grouping the data). So
> then I took my
> "all.csv", removed the unwanted columns and
> imported it into R as "small".
> > aggregate(small, list(sc_recov), mean)
> Error in FUN(X[[1L]], ...) : arguments must have same
> Any thoughts?
> Thank you kindly,
> M Just
> [[alternative HTML version deleted]]
> R-help at r-project.org mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained,
> reproducible code.
[[elided Yahoo spam]]
More information about the R-help