| glimpse.Spat | R Documentation |
Spat* objectsglimpse() 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.
## 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)
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 |
original x is (invisibly) returned, allowing glimpse() to
be used within a data pipeline.
print()
Implementation of the generic dplyr::glimpse() function for
Spat*. objects.
tibble::print.tbl_df()
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()
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.