Re: [R] Aggregate?

From: Ingmar Visser <I.Visser_at_uva.nl>
Date: Fri 08 Dec 2006 - 10:48:57 GMT


It does that for me without errors ...
(R 2.3.1 on Mac OSX 10.4.8)
Best, Ingmar

> From: Gustaf Rydevik <gustaf.rydevik@gmail.com>
> Date: Fri, 8 Dec 2006 12:58:01 +0300
> To: <r-help@stat.math.ethz.ch>
> Subject: [R] Aggregate?
>
> Hi All,
>
> I think i'm failing to undersatnd how aggregate() is supposed to work.
>
> example:
>
> test1<-sample(c(0,1),100,replace=T)
> test2<-sample(letters,100,replace=T)
> aggregate(test1,list(test2),sum)
> Error in data.frame(w, lapply(y, unlist, use.names = FALSE)) :
> arguments imply differing number of rows: 26, 0
>
> I thought this would give me a list containing the number of ones that
> "belong" to each letter. What am I doing wrong?
>
> Thanks in advance,
>
> Gustaf
>
> --
> email:gustaf.rydevik@gmail.com
> tel: +46(0)703051451
> address: Kantorsgatan 50:190 75424 Uppsala Sweden
>
> ______________________________________________
> R-help@stat.math.ethz.ch 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.



R-help@stat.math.ethz.ch 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 Sat Dec 09 07:57:41 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 08 Dec 2006 - 21: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.