Hi everyone,
I want to perform an inner-join on two sets of data that have no unique identifier, but do have unique latitude and longitudes (separate columns).
Can anyone suggest a method for joining two tables based on two columns?
Sincerely,
Schyler Brown
Here's the base R way:
merge(table1, table2, by.x=c("lat","long"), by.y=c("lat","long"))
And here's the dplyr way:
table1>%>
inner_join(table2, by=c("lat"="lat", "long"="long"))
These both assume that latitude and longitude are perfect matches.
1 Like
It's really that simple huh? Thank you so much dephilli!!!!
system
Closed
4
This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.
If you have a query related to it or one of the replies, start a new topic and refer back with a link.