Skip to contents

Glance accepts a model object and returns a tibble::tibble() with exactly one row of Spat. The summaries are typically geographic information.

Usage

# S3 method for class 'SpatRaster'
glance(x, ...)

# S3 method for class 'SpatVector'
glance(x, ...)

Arguments

x

A SpatRaster created with terra::rast() or a SpatVector created with terra::vect().

...

Ignored by this method.

Value

glance methods always return a one-row data frame. See Methods.

Methods

Implementation of the generic generics::glance() method for Spat*. objects.

Examples


library(terra)

# SpatVector
v <- vect(system.file("extdata/cyl.gpkg", package = "tidyterra"))

glance(v)
#> # A tibble: 1 × 10
#>   geometry  nrow  ncol     xmin     xmax     ymin    ymax source crs   crs_units
#>   <chr>    <dbl> <dbl>    <dbl>    <dbl>    <dbl>   <dbl> <chr>  <chr> <chr>    
#> 1 polygons     9     3 2892687. 3341372. 2017622.  2.36e6 cyl.g… ETRS… meter    

# SpatRaster
r <- rast(system.file("extdata/cyl_elev.tif", package = "tidyterra"))

glance(r)
#> # A tibble: 1 × 16
#>    nrow  ncol  nlyr ncell  xres  yres  xmin  xmax  ymin  ymax crs      crs_units
#>   <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <chr>    <chr>    
#> 1   126   212     1 26712 0.025 0.025 -7.08 -1.77  40.1  43.2 lon/lat… degrees  
#> # ℹ 4 more variables: source <chr>, has_rgb <lgl>, has_colors <lgl>,
#> #   has_time <lgl>