calRaster {assignR}R Documentation

Rescale isoscape using linear regression

Description

This function uses known-origin tissue data to rescale a map of environmental isotope values to a map of tissue value (and associated uncertainty) using a linear regression model.

Usage

calRaster(known, isoscape, mask = NULL, interpMethod = 2, NA.value = NA, 
  ignore.NA = TRUE, genplot = TRUE, outDir =  NULL, verboseLM = TRUE)

Arguments

known

subOrigData or SpatVector. Known-origin tissue isotope data from the subOrigData function or provided by user. User-provided data must be formatted as a subOrigData object (see subOrigData) or a SpatVector with point geometry in which the first data field contains the measured tissue isotope value and the second the 1 standard deviation uncertainty on that value.

isoscape

SpatRaster. Isoscape raster with two layers. The first one is the mean and the second is one standard deviation.

mask

SpatVector. Polygon layer that constrains the area of the output rasters. If this is not provided, the entire area of isoscape is returned.

interpMethod

numeric. 1 or 2. Designate one of two methods for extracting values from isoscape. If 1, values for the cell in which a point falls are returned. If 2 the returned values are interpolated (bilinear interpolation) from the values of the four adjacent grid cells.

NA.value

NA or numeric. Value representing the absence of data in isoscape. Commonly used values include NA, -9999, and 9999.

ignore.NA

logical. If NA values are extracted from isoscape at the location of samples in known, ignore these values and proceed with calRaster.

genplot

logical. Plot the results.

outDir

character string. Directory path to which output will be saved. If NULL no files are written.

verboseLM

logical. Print out the linear regression results.

Value

Returns an object of class “rescale”.

isoscape.rescale

SpatRaster. isoscape rescaled using a linear regression model between values of known and isoscape. The first layer is the mean prediction and the second the standard deviation.

lm.data

data.frame. Known origin data and extracted isoscape values used for linear regression modeling.

lm.model

list. Linear regression model.

See Also

pdRaster

Examples

# load hydrogen isotope data for human hair in North America
d = subOrigData(group = "Modern human", mask = naMap, niter = 100, genplot = FALSE)

# rescale from environmental isoscape to tissue isoscape
r = calRaster(d, d2h_lrNA, naMap)

[Package assignR version 2.4.1 Index]