get_vectype: check the "spatial type" of an object or file

Description Usage Arguments Value Note

Description

Check if a R object or a filename correspond to a valid vector object, to a vector file or none of the above. Useful to detect which kind of input is passed to a function and abort / do something in the case of "wrong" input.

Usage

1
get_vectype(in_vect, abort = TRUE)

Arguments

in_vect

name of an R object, or character giving the full path to a vector file

abort

If TRUE, and in_vect is neither a spatial object or filename, send an error message and abort, Default: TRUE

Value

character equal to "vectfile" (if in_vect is a raster file), spobject (if in_vect is of class spatial), sfobject (if in_vect is of class sf), or NA if it is neither (unless abort == TRUE)

Note

Functions get_spatype, get_rastype and get_vectype come from package sprawl.


pobsteta/theia2r documentation built on May 25, 2019, 2:21 p.m.