as.points | R Documentation |
Conversion of a SpatRaster, SpatVector or SpatExtent to a SpatVector of points.
## S4 method for signature 'SpatRaster'
as.points(x, values=TRUE, na.rm=TRUE, na.all=FALSE)
## S4 method for signature 'SpatVector'
as.points(x, multi=FALSE, skiplast=TRUE)
## S4 method for signature 'SpatExtent'
as.points(x, crs="")
x |
SpatRaster, SpatVector or SpatExtent |
values |
logical; include cell values as attributes? |
multi |
logical. If |
skiplast |
logical. If |
na.rm |
logical. If |
na.all |
logical. If |
crs |
character. The coordinate reference system (see |
SpatVector
as.lines
, as.points
r <- rast(ncols=2, nrows=2)
values(r) <- 1:ncell(r)
as.points(r)
if (gdal() >= "3.0.0") {
p <- as.polygons(r)
as.points(p)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.