factorValues2: Faster version of 'raster::factorValues()'

View source: R/gis.R

factorValues2R Documentation

Faster version of raster::factorValues()

Description

Note there is an option to remove the NAs, which will make it MUCH faster, if TRUE

Usage

factorValues2(x, v, layer, att, append.names, na.rm = FALSE)

Arguments

x

Raster* object

v

integer cell values

layer

integer > 0 indicating which layer to use (in a RasterStack or RasterBrick)

att

numeric or character. Which variable(s) in the RAT table should be used. If NULL, all variables are extracted. If using a numeric, skip the first two default columns

append.names

logical. Should names of data.frame returned by a combination of the name of the layer and the RAT variables? (can be useful for multilayer objects

na.rm

Logical. If TRUE, then the NAs will be removed, returning a possibly shorter vector


PredictiveEcology/pemisc documentation built on Sept. 19, 2022, 7 p.m.