
Layer points in SpatialPointsDataFrame object
Source:R/l_layer_sp.R
l_layer.SpatialPointsDataFrame.Rd
Methods to plot map data defined in the sp
package
Usage
# S3 method for class 'SpatialPointsDataFrame'
l_layer(widget, x, asMainLayer = FALSE, ...)
Arguments
- widget
widget widget path as a string or as an object handle
- x
an object defined in the
sp
class- asMainLayer
if
TRUE
and the widget is a scatterplot widget, then points can be chosen to be added to the'model'
layer- ...
arguments forwarded to the relative
l_layer
function
References
Applied Spatial Data Analysis with R by Bivand, Roger S. and Pebesma, Edzer and Gomez-Rubio and Virgilio
See also
sp
, l_layer
Examples
if (interactive()) {
if (requireNamespace("rworldmap", quietly = TRUE)) {
world <- rworldmap::getMap(resolution = "coarse")
p <- l_plot()
lmap <- l_layer(p, world, asSingleLayer=TRUE)
l_scaleto_world(p)
attr(lmap,'hole')
attr(lmap,'NAME')
}
}