Re: [R] Multiple subsets of data

From: John Kane <jrkrideau_at_yahoo.ca>
Date: Thu, 06 Jan 2011 07:09:19 -0800 (PST)


Is there any common variable? From your description, I don't see how you would link a species to a community. I mean if you select species a in df1 how would you know what community it is in?

> From: Chris Mcowen <chrismcowen_at_gmail.com>
> Subject: [R] Multiple subsets of data

> To: r-help_at_r-project.org
> Received: Thursday, January 6, 2011, 6:29 AM
> Dear List,
>
> I have a data frame called trait with roughly 800 species
> in, each species have 15 columns of information:
>
> Species       
> 1    2    3   
> etc..
> a           
> t    y    h
> b           
> f    j    u
> c           
> r    y    u
>
> etc..
>
>
> I then have another data frame called com with the
> composition of species in each region, there are 506
> different communities:
>
> community    species
> NA1102        a
> NA1102        c
> NA0402        b
> NA0402        c
> AT1302        a
> AT1302        b
>
> etc..
>
>
> What i want to do is extract the information held in the
> first data frame for each community and save this as a new
> data frame.
>
> Resulting in : -
>
> community_NA1102   
>
> a           
> t    y    h
> c           
> r    y    u
>
> community_NA0402   
>
> b           
> f    j    u
> c           
> r    y    u
>
> Thanks in advance for any suggestions / code.
> ______________________________________________
> 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.
>



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 Thu 06 Jan 2011 - 15:10:59 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 06 Jan 2011 - 16:10:04 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