set_raster_values: Replacement of non-NA values of a raster

Description Usage Arguments Value

View source: R/raster_convenience_internal.R

Description

Takes raster* objects as input and replaces all non-NA values with values specified in a data.frame. Multiple columns will return RasterStack's.

Usage

1

Arguments

raster

A raster* object. All non-NA values of raster will be replaced. If raster is a RasterStack, each layer has to have identical na-cells.

data

A data.frame with as many rows as there are non-NA values in raster.

Value

A RasterLayer if data has only one column. A RasterBrick if multiple columns were specified in data. Character and factor data will lead to the creation of factor layers.


JonasGlatthorn/APAtree documentation built on Dec. 18, 2021, 1:41 a.m.