lines | R Documentation |
Add a vector geometries to a plot (map) with points
, lines
, or polys
.
These are simpler alternatives for plot(x, add=TRUE)
These methods also work for a small(!) SpatRaster. Only cells that are not NA in the first layer are used.
## S4 method for signature 'SpatVector'
points(x, col, cex=0.7, pch=16, alpha=1, ...)
## S4 method for signature 'SpatVector'
lines(x, y=NULL, col, lwd=1, lty=1, arrows=FALSE, alpha=1, ...)
## S4 method for signature 'SpatVector'
polys(x, col, border="black", lwd=1, lty=1, alpha=1, ...)
## S4 method for signature 'SpatRaster'
points(x, ...)
## S4 method for signature 'SpatRaster'
lines(x, mx=10000, ...)
## S4 method for signature 'SpatRaster'
polys(x, mx=10000, dissolve=TRUE, ...)
## S4 method for signature 'SpatExtent'
points(x, col="black", alpha=1, ...)
## S4 method for signature 'SpatExtent'
lines(x, col="black", alpha=1, ...)
## S4 method for signature 'SpatExtent'
polys(x, col, alpha=1, ...)
x |
SpatVector or SpatExtent |
y |
missing or SpatVector. If both |
col |
character. Colors |
border |
character. color(s) of the polygon borders. Use |
cex |
numeric. point size magnifier. See |
pch |
positive integer, point type. See |
alpha |
number between 0 and 1 to set transparency |
lwd |
numeric, line-width. See |
lty |
positive integer, line type. See |
arrows |
logical. If |
mx |
positive number. If the number of cells of SpatRaster |
dissolve |
logical. Should boundaries between cells with the same value be removed? |
... |
additional graphical arguments such as |
f <- system.file("ex/lux.shp", package="terra")
v <- vect(f)
r <- rast(v)
values(r) <- 1:ncell(r)
plot(r)
lines(v)
points(v)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.