[R] How to "vectorize" subsetting

Steve Lianoglou lianoglou.steve at gene.com
Wed Aug 14 20:36:58 CEST 2013


Howdy,

On Wed, Aug 14, 2013 at 9:40 AM, Bert Gunter <gunter.berton at gene.com> wrote:
> mod Jeff Newmiller's comments...
>
> 1. Have you read"An Introduction to R? (or other basic tutorial --
> there are many on the web). If no, stop posting and do so. This will
> help you to understand R's basic data manipulation capabilities and
> structures (list, "apply" type functions,...).
>
> 2. mod 1), perhaps
>
> ?tapply (and friends like ?ave, ?aggregate, ?by)
> ?split

... and after you've discovered the existence and explored the
functionality of these functions, run (don't walk) over to check out
the plyr package:

http://plyr.had.co.nz

And read through this relevant chapter in Hadley's book:
https://github.com/hadley/devtools/wiki/functionals#data-structure-functionals

It will take you through looping, to *apply-ing, to plyr-ing

HTH,
-steve

-- 
Steve Lianoglou
Computational Biologist
Bioinformatics and Computational Biology
Genentech



More information about the R-help mailing list