[R] Joining Dataframes
Matt Goff
goff at nawwal.org
Tue Oct 4 21:37:07 CEST 2005
I am attempting to join several dataframes that summarize sampling effort
for different samples into one large data.frame/table.
I have looked at the merge command, but have not been clever enough to
figure out how to get it to do what I want.
A simplified example of what I am trying to do:
The dataframes I have look like this (they were generated using the table
command)
species1.effort
site1 site2 site3
date1 5 5 5
date2 4 5 5
date3 4 5 5
species2.effort
site1 site2 site3
date1 7 8 6
date3 8 7 8
date4 8 8 8
I would like to join these into a table that looks something like this:
Effort
sp1.site1 sp1.site2 sp1.site3 sp2.site1 sp2.site2
sp2.site2
date1 5 5 5 7
8 6
date2 4 5 5 NA
NA NA
date3 4 5 5 8
7 8
date4 NA NA NA 8 8
8
I have many more dates and species, but I assume whatever method works for
this small example, would work for larger cases.
Thanks,
Matt Goff
More information about the R-help
mailing list