calRaster {assignR}R Documentation

Rescale isoscape using linear regression


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.


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



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.


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


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


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 or numeric. Value representing the absence of data in isoscape. Commonly used values include NA, -9999, and 9999.


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


logical. Plot the results.


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


logical. Print out the linear regression results.


Returns an object of class “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.

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


list. Linear regression model.

See Also



# 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.0 Index]