spatial_data_type: Spatial data type

View source: R/utils_spatial_data_type.R

spatial_data_typeR Documentation

Spatial data type

Description

Identify if a spatial dataset has continuous or categorical data.

Usage

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

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

## S3 method for class 'SpatRaster'
spatial_data_type(x, index = 1, max_sample = 10000, ...)

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

Arguments

x

sf::st_sf() or combined terra::rast() 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".


NCC-CNC/wheretowork documentation built on Feb. 27, 2025, 6:11 p.m.