glimpse.Spat {tidyterra} | R Documentation |
Get a nice glimpse of your Spat*
objects
Description
glimpse()
is like a transposed version of print()
: layers/columns run
down the page, and data runs across. This makes it possible to see every
layer/column in a Spat*
object.
Usage
## S3 method for class 'SpatRaster'
glimpse(x, width = NULL, ..., n = 10, max_extra_cols = 20)
## S3 method for class 'SpatVector'
glimpse(x, width = NULL, ..., n = 10, max_extra_cols = 20)
Arguments
x |
A |
width |
Width of output: defaults to the setting of the width option
(if finite) or the width of the console. See |
... |
Arguments passed on to |
n |
Maximum number of rows to show. |
max_extra_cols |
Number of extra columns or layers to print abbreviated
information for, if |
Value
original x
is (invisibly) returned, allowing glimpse()
to
be used within a data pipeline.
terra equivalent
print()
Methods
Implementation of the generic dplyr::glimpse()
function for
Spat*
. objects.
See Also
Other dplyr verbs that operate on columns:
mutate.Spat
,
pull.Spat
,
relocate.Spat
,
rename.Spat
,
select.Spat
Other dplyr methods:
arrange.SpatVector()
,
bind_cols.SpatVector
,
bind_rows.SpatVector
,
count.SpatVector()
,
distinct.SpatVector()
,
filter-joins.SpatVector
,
filter.Spat
,
group-by.SpatVector
,
mutate-joins.SpatVector
,
mutate.Spat
,
pull.Spat
,
relocate.Spat
,
rename.Spat
,
rowwise.SpatVector()
,
select.Spat
,
slice.Spat
,
summarise.SpatVector()
Examples
library(terra)
# SpatVector
v <- vect(system.file("extdata/cyl.gpkg", package = "tidyterra"))
v %>% glimpse(n = 2)
# Use on a pipeline
v %>%
glimpse() %>%
mutate(a = 30) %>%
# with options
glimpse(geom = "WKT")
# SpatRaster
r <- rast(system.file("extdata/cyl_elev.tif", package = "tidyterra"))
r %>% glimpse()
# Use on a pipeline
r %>%
glimpse() %>%
mutate(b = elevation_m / 100) %>%
# With options
glimpse(xy = TRUE)