Coversion to a SpatVector of points.
Usage
# S4 method for class 'data.frame'
as.points(x, include_values = TRUE, specific_values = NULL)
Arguments
- x
SpatRaster, SpatVector, SpatExtent, or correctly formatted data.frame
- include_values
logical
. Whether to include additional columns other than the geometry information asSpatVector
attributes. Default is TRUE.- specific_values
character
. Specific subset of columns to include as attributes ifinclude_values = TRUE
.
See also
Other As coercion functions:
as.data.table()
,
as.matrix()
,
as.polygons()
,
r_spatial_conversions
Examples
g <- GiottoData::loadSubObjectMini("giottoPoints")
as.points(slot(g, "spatVector"))
#> Warning: [as.points] returning a copy
#> class : SpatVector
#> geometry : points
#> dimensions : 79761, 3 (geometries, attributes)
#> extent : 6400.037, 6900.032, -5149.983, -4699.979 (xmin, xmax, ymin, ymax)
#> coord. ref. :
#> names : feat_ID global_z feat_ID_uniq
#> type : <chr> <int> <int>
#> values : Mlc1 0 1
#> Gprc5b 0 2
#> Gfap 0 3