Learn R Programming

tidyterra (version 1.0.0)

required_pkgs.Spat: Determine packages required by Spat* objects

Description

Determine packages required by Spat* objects.

Usage

# S3 method for SpatRaster
required_pkgs(x, ...)

# S3 method for SpatVector required_pkgs(x, ...)

# S3 method for SpatGraticule required_pkgs(x, ...)

# S3 method for SpatExtent required_pkgs(x, ...)

Value

A character string of packages that are required.

Arguments

x

A SpatRaster created with terra::rast() or a SpatVector created with terra::vect(). Also support SpatGraticule (see terra::graticule()) and SpatExtent (see terra::ext()).

...

Ignored by these methods.

Methods

Implementation of generics::required_pkgs() method.

See Also

generics::required_pkgs().

Other generics methods: glance.Spat, tidy.Spat

Examples

Run this code
file_path <- system.file("extdata/cyl_temp.tif", package = "tidyterra")


library(terra)

r <- rast(file_path)

# With rasters
r
required_pkgs(r)

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

Run the code above in your browser using DataLab