Description Usage Arguments Examples
Plot a line map.
1 2 3 4 5 6 7 8 9 10 |
x |
a data.frame, two first column must be longitudes and latitudes of gridded data. |
var |
name of the variable to plot. |
k |
expension factor. |
threshold |
threshold of the data to plot. |
col |
color for the lines areas. |
border |
color for the lines borders. |
lwd |
thickness of the lines. |
add |
if TRUE add the lines to the current plot. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | library(linemap)
data("popOcc")
# example on an extract of the gridded data
popToulouse <- popOcc[findInterval(popOcc$X, c(3600234,3659444)) == 1 &
findInterval(popOcc$Y, c(2290913,2348192)) == 1, ]
opar <- par(mar=c(0,0,0,0), bg = "ivory1")
linemap(x = popToulouse, var = "pop", k = 2.5, threshold = 50,
col = "ivory1", border = "ivory4", lwd = 0.6, add = FALSE)
par(opar)
# example on the full dataset
library(sf)
occitanie <- st_read(system.file("gpkg/geofla.gpkg", package = "linemap"),
layer = "Occitanie")
opar <- par(mar=c(0,0,0,0), bg = "ivory2")
plot(st_geometry(occitanie), col="ivory1", border = NA)
linemap(x = popOcc, var = "pop", k = 2.5, threshold = 50,
col = "ivory1", border = "ivory4", lwd = 0.6, add = TRUE)
par(opar)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.