datatype | R Documentation |
Get the data types of the fields (attributes, variables) of a SpatVector or of the file(s) associated with a SpatRaster. A (layer of a) SpatRaster has no datatype if it has no values, or if the values are in memory.
## S4 method for signature 'SpatRaster'
datatype(x, bylyr=TRUE)
## S4 method for signature 'SpatVector'
datatype(x)
x |
SpatRaster or SpatVector |
bylyr |
logical. If |
character
Raster data types
to check / set the type of SpatRaster values.
f <- system.file("ex/lux.shp", package="terra")
v <- vect(f)
datatype(v)
f <- system.file("ex/elev.tif", package="terra")
r <- rast(f)
datatype(r)
# no data type
datatype(rast())
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.