Quantcast

Merging Data Frames in R

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Merging Data Frames in R

ksm13
This post has NOT been accepted by the mailing list yet.
Hi there,

I have two data frames, each with 30,000+ entries, that I'm trying to merge into one.

The first, which I'll call Pan, is a list of animals, and is organized by genus and species. This data frame has biological data.

The second, which I'll call IUCN, is another list of animals, and is organized by reference number. This data frame has economic data.

My goal is to merge the two data frames such that two columns from IUCN (red list status and population) will be added to Pan. I do not want to carry over any other data from IUCN, and I want the data to exist only for the species that are in both data frames (in other words, I want the new data frame to be organized by genus and species). For species that are only in Pan, I want the entry to read NA, and I do not want any species only in IUCN to be represented in the data at all.

Is there any way to do this?

If you require more details, my email is seditio_placida@yahoo.com.

Thank you in advance for your help!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Merging Data Frames in R

Yasir Kaheil
type ?merge in R
Yasir Kaheil
Loading...