The pages of StackOverflow are littered with questions about how to merge a regular data frame to a
spatial data frame in R. The merge
function from the sp package operates under a strict set of
assumptions, which if violated will break your data. This function wraps a couple StackOverflow answers
I've seen that work in a friendlier syntax.
1 | geo_join(spatial_data, data_frame, by_sp, by_df)
|
spatial_data |
A spatial data frame to which you want to merge data. |
data_frame |
A regular data frame that you want to merge to your spatial data. |
by_sp |
The column name you'll use for the merge from your spatial data frame. |
by_df |
The column name you'll use for the merge from your regular data frame. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.