I have two data frames with separate information, but are related by the PLOT column. In this column, the identifier for a plot is listed (i.e. both data frames have "HI 2").
- The first data frame, data.csv, contains GPS coordinates for each PLOT.
- The second has eelgrass shoot density.
My question is how can I merge these so that both the GPS coordinates and eelgrass shot density are together in a single data frame?
An example of what each data frame looks like:
head(data)
| PLOT | SIZE | EAST | NORTH |
|---|---|---|---|
| HI 1 | 1.0 | 435500.0 | 4140520 |
| HI 2 | 0.5 | 435650.0 | 4140520 |
head(density)
| PLOT | SIZE | DENSITY | SEEDYR |
|---|---|---|---|
| HI 2 | 1.0 | 50 | 2006 |
| HI 5 | 0.5 | 100 | 2006 |
So, I need to merge it so that it knows HI2 should have a single line with EAST, NORTH, and DENSITY all merged together. There are a fair few more lines, some that match and some that don't (i.e. HI 1 and HI 5).
Thank you!