View source: R/mergeDataframeWithLayer.R
mergeDataframeWithLayer | R Documentation |
This function merges (joins) a dataset with (to) a geometry layer.
mergeDataframeWithLayer(
dfr,
geoms,
dataID = "GIS_STATION",
geomsID = "STATION_ID",
sfJoinType = c("right join", "left join", "inner join", "full join"),
spAllData = FALSE,
spDuplicateGeoms = TRUE
)
dfr |
|
geoms |
|
dataID |
|
geomsID |
|
sfJoinType |
|
spAllData |
|
spDuplicateGeoms |
|
Uses packages dplyr
, sf
and sp
.
If geoms is an sp dataset, the merge is conducted using sp:merge
.
If geoms is an sf dataset, it is conducted using one of the join functions
in package dplyr
. The results of this join will depend on the join type:
right join: matched rows in dfr
, all rows in geoms
left join: all rows in dfr
, matched rows in geoms
inner join: only rows in dfr
matched to geoms
full join: all rows in dfr
and all rows in geoms
The join column will take its name from dataID
in dfr
and will not include
a column named geomsID
.
sf or sp dataframe (depending on the class of the geoms object).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.