as_numeric_raster: As Numeric Raster

Description Usage Arguments Details Value Examples

Description

Converts a raster of factor values to the a raster of the corresponding numeric values. Somewhat more efficient than get_depth_from_lutable, but can still take a long time for big rasters. See raster::factor documentation.

Usage

1

Arguments

r

a raster with an attribute table

att

column of the attribute to extract

Details

Given a raster with data values coded in an attribute table, creates a raster directly composed of those values. Loops over every entry in the raster; it is not very efficient.

Value

r2 raster of numeric values coded from the input raster

Examples

1
2
3
umesc <- raster("/Users/jschap/Box Sync/Margulis_Research_Group/Jacob/UMBB/Data/UMESC/bath_pool_21/bath_1999_p21")
umesc <- raster("bath_pool_21/bath_1999_p21")
depth <- as_numeric_raster(umesc, att = "DEPTH_M")

jschap1/WSEw documentation built on May 12, 2019, 10:50 a.m.