Description Usage Arguments Value Examples
Adds variable(s) to a SpatialPolygons
1 | add_variable_sp(sp, df)
|
sp |
A SpatialPolygons object. |
df |
A vector or a data frame. |
A SpatialPolygonsDataFrame
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | # download vietnam admin1 administrative map in the internal library and in
# the working direction
vn <- sptools::gadm("vietnam", "sp", 1, intlib = TRUE, save = TRUE)
vn_nodata <- remove_data_spatialpolygons(vn)
vn_nodata
a <- runif(63)
vn_data <- add_variable_sp(vn_nodata, a)
vn_data
# An example with a data frame:
vn_data2 <- add_variable_sp(vn_nodata,
data.frame(b = rnorm(63), c = rexp(63)))
vn_data2
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.