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 SpatialPointsDataFrame. 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 SpatialPointsDataFrame in which the first data field contains the measured tissue isotope value and the second the 1 standard deviation uncertainty on that value.

isoscape

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

mask

SpatialPolygonsDataFrame. 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

RasterBrick. 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 North America boundary and global isoscape
data("naMap")
data("d2h_lrNA")

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

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

[Package assignR version 2.1.0 Index]