[R] How to use tapply with more than one variables grouped

PIKAL Petr petr.pikal at precheza.cz
Mon Oct 22 11:00:38 CEST 2012


Hi

> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of noobmin
> Sent: Monday, October 22, 2012 2:28 AM
> To: r-help at r-project.org
> Subject: [R] How to use tapply with more than one variables grouped
> 
> I'm studying alone the R language for data preparation. I found a
> course at MIT for data preparation that uses python but I'm using R to
> learning. The first exercise is the preparation of data from a database
> that shows the contributions made to candidates for U.S. president. The
> database is described in FORMART
> ftp://ftp.fec.gov/FEC/Presidential_Map/2012/DATA_DICTIONARIES/CONTRIBUT
> OR_FORMAT.txt
> link. I wonder how to print the table showing how many states are
> President Obama the top candidate (by full amount of donations
> received) with R language?
> 
> I try using tapply method but, i dont understand how to working with
> more than one variable grouped. Could anyone help me in advance of the
> studies?
> 
How did you use tapply? Did you read help page? It points to ?aggregate which is maybe what you are looking for.

Regards
Petr

> 
> 
> --
> View this message in context: http://r.789695.n4.nabble.com/How-to-use-
> tapply-with-more-than-one-variables-grouped-tp4646948.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> ______________________________________________
> 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.




More information about the R-help mailing list