Description Usage Arguments Value Examples
accessory function to check if an object passed to the function corresponds to
a *Spatial
Object, a sf
object, a R raster
object, a file corresponding to a vector,
or a file corresponding to a raster
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | get_spatype(object, abort = FALSE)
## Default S3 method:
get_spatype(object, abort = FALSE)
## S3 method for class 'character'
get_spatype(object, abort = FALSE)
## S3 method for class 'Raster'
get_spatype(object, abort = FALSE)
## S3 method for class 'sf'
get_spatype(object, abort = FALSE)
## S3 method for class 'sfc'
get_spatype(object, abort = FALSE)
## S3 method for class 'Spatial'
get_spatype(object, abort = FALSE)
|
object |
either a |
abort |
|
character vector equal to spobject, sfobject, rastobject, vectfile or rastfile
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## Not run:
library(sprawl.data)
# input is a raster file
get_spatype(system.file("extdata","sprawl_EVItest.tif", package = "sprawl.data"))
# input is a shapefile
shp_file <- system.file("extdata","lc_polys.shp", package = "sprawl.data")
get_spatype(shp_file)
# input is a `sp` object
obj <- read_vect(shp_file, as_sp = TRUE)
get_spatype(obj)
# input is a `sf` object
obj <- read_vect(shp_file)
get_spatype(obj)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.