Identify if a spatial dataset has continuous or categorical data.

spatial_data_type(x, index = 1, ...)

# S3 method for sf
spatial_data_type(x, index = 1, ...)

# S3 method for Raster
spatial_data_type(x, index = 1, max_sample = 10000, ...)

# S3 method for data.frame
spatial_data_type(x, index = 1, ...)

Arguments

x

sf::st_sf() or raster::stack() or data.frame dataset object.

index

integer or character value indicating the field or layer for which to calculate statistics. Defaults to 1, such that the first field/layer is used to calculate statistics.

...

not used.

max_sample

integer maximum number of cells in a raster stack to sample when checking if the data are continuous or categorical. Defaults to 10000.

Value

A character indicating if the data are "continuous" or "categorical".