Skip to contents

Detect whether the input object is sf or Spat* object.

Usage

dep_check(input)

Arguments

input

Spat* in terra or sf object.

Value

A character object; one of "terra" and "sf"

Author

Insang Song

Examples

library(sf)
library(terra)
options(sf_use_s2 = FALSE)

nc_path <- system.file("gpkg/nc.gpkg", package = "sf")
nc_sf <- sf::st_read(nc_path)
#> Reading layer `nc.gpkg' from data source 
#>   `/home/runner/work/_temp/Library/sf/gpkg/nc.gpkg' using driver `GPKG'
#> Simple feature collection with 100 features and 14 fields
#> Geometry type: MULTIPOLYGON
#> Dimension:     XY
#> Bounding box:  xmin: -84.32385 ymin: 33.88199 xmax: -75.45698 ymax: 36.58965
#> Geodetic CRS:  NAD27
dep_check(nc_sf)
#> [1] "sf"
nc_vect <- terra::vect(nc_sf)
dep_check(nc_vect)
#> [1] "terra"
## END OF EXAMPLE