I have a dataframe
of observations (Coral)
that are geo referenced by latitude
and longitude
- lat and lon
I have another dataframe (Lat_Lon)
which gives a sequence number (seq)
to each grid point - lat, lon
How do I match the lat and lon
from the Coral
dataframe with the lat and lon
from the Lat_Lon dataframe
and return the sequence number (seq) to the Coral
dataframe as a new column?
I want the dataframe of observations (Coral)
to be geo referenced by the sequence number (seq) as well as by lat
and lon
> summary.default(Coral)
Length Class Mode
UNIQUE_ID 14705 -none- numeric
SURVEY_ID 14705 -none- numeric
lat 14705 -none- numeric
lon 14705 -none- numeric
> summary.default(Lat_Lon)
Length Class Mode
seq 259200 -none- numeric
lon 259200 -none- numeric
lat 259200 -none- numeric
dput(head(Coral))
structure(list(UNIQUE_ID = 229:234, SURVEY_ID = c(2387L, 2387L,
2387L, 2390L, 2390L, 2390L), lat = c(7.25, 7.25, 7.25, 7.25,
7.25, 7.25), lon = c(99.25, 99.25, 99.25, 99.25, 99.25, 99.25
)), .Names = c("UNIQUE_ID", "SURVEY_ID", "lat", "lon"), row.names = c(NA,
6L), class = "data.frame")
dput(head(Lat_Lon))
structure(list(seq = c(1, 2, 3, 4, 5, 6), lon = c(-179.75, -179.25,
-178.75, -178.25, -177.75, -177.25), lat = c(89.75, 89.75, 89.75,
89.75, 89.75, 89.75)), .Names = c("seq", "lon", "lat"), row.names = c(NA,
6L), class = "data.frame")