Learn R Programming

IsoriX (version 0.4-1)

Isoscape: Predicts the spatial distribution of isotopic values

Description

This function produces the isoscape, i.e. a spatial prediction (i.e. map) of the distribution of isotopic delta values. Predictions are computed using the fitted isoscape for each raster cell of the elevation raster. All shape files can be exported and loaded into any Geographic Information System (GIS) if needed.

Usage

Isoscape( elevation.raster, isofit, verbose=interactive() )

Arguments

elevation.raster
The elevation raster (RasterLayer) created by RElevate
isofit
The fitted isoscape created by Isofit
verbose
A logical indicating whether information about the progress of the procedure should be displayed or not while the function is running. By default verbose is TRUE if users use an interactive R session and FALSE otherwise.

Value

list of class isoscape containing a stack of all 8 raster layers mentioned above (all being of class RasterLayer), and the location of the sources as spatial points.

Details

This function computes the predictions (mean), prediction variances (mean.predVar), residual variances (mean.residVar) and response variances (mean.respVar) for the isotopic values at a resolution equal to the one of the elevation raster. It also computes the same information for the residual dispersion variance (disp.pred, disp.predVar, disp.residVar, or disp.respVar).

The predictions of isotopic values across the landscape are performed by calling the function predict from the package spaMM on the fitted isoscape produced by Isofit.

Let us detail the meaning of mean, mean.predVar and mean.respVar:

Our model assumes that that there is a single true unknown isoscape, which is fixed but which is represented by the mixed-effect model as a random draw from possible realizations of isoscapes (random draws of the Matern-correlated process and of the uncorrelated random effects if considered). We infer this realized isoscape by fitting the model to a limited amount of data, with some uncertainty since different random draws of the unknown isoscape may give the same observed data. There is thus a conditional distribution of possible true isoscapes given the data. For linear mixed-effects models, the mean prediction, technically called the best linear unbiased prediction (BLUP), is the mean of this conditional distribution. The prediction variance is ideally the mean square difference between the true unknown value of the linear predictor and the BLUP at a given location. The response variance has a different meaning. It estimates the variance of new observations drawn from the true unknown isoscape at a given location. The response variance is simply equal to the sum of the prediction variance and the residual variance (note that the residual variance considered assume that a single observation is being observed per location).

The isoscape can be plotted using the function plot.isoscape (see examples).

See Also

Isofit for the function fitting the isoscape

plot.isoscape for the function plotting the isoscape model

IsoriX for the complete work-flow

Examples

Run this code

## The following display takes a few seconds too many and will therefore not
## be run unless you type: example(Isoscape, run.dontrun=TRUE)

## Not run: 
# 
# data(elevationrastersmall)
# data(GNIP_Model)
# data(worldcountries)
# data(oceanmask)
# data(isoscapepalette)
# 
# ## We crop the elevation raster to the extent of GNIP_Model
# elevationraster <- RElevate(
#     elevation.raster=elevationrastersmall,
#     isofit=GNIP_Model)
# 
# ## We build the isoscape
# isoscape <- Isoscape(
#     elevation.raster=elevationraster,
#     isofit=GNIP_Model)
# 
# isoscape
# 
# plot.mean <- plot(
#     x=isoscape,
#     which="mean",
#     borders=list(borders=worldcountries),
#     mask=list(mask=oceanmask),
#     palette=isoscapepalette,
#     plot=FALSE)
# 
# plot.mean.predVar <- plot(
#     x=isoscape,
#     which="mean.predVar",
#     borders=list(borders=worldcountries),
#     mask=list(mask=oceanmask),
#     palette=isoscapepalette,
#     plot=FALSE)
# 
# plot.mean.residVar <- plot(
#     x=isoscape,
#     which="mean.residVar",
#     borders=list(borders=worldcountries),
#     mask=list(mask=oceanmask),
#     palette=isoscapepalette,
#     plot=FALSE)
# 
# plot.mean.respVar <- plot(
#     x=isoscape,
#     which="mean.respVar",
#     borders=list(borders=worldcountries),
#     mask=list(mask=oceanmask),
#     palette=isoscapepalette,
#     plot=FALSE)
# 
# if(require(lattice)) {
#     print(plot.mean, split=c(1, 1, 2, 2), more=TRUE)
#     print(plot.mean.predVar,   split=c(2, 1, 2, 2), more=TRUE)
#     print(plot.mean.residVar,  split=c(1, 2, 2, 2), more=TRUE)
#     print(plot.mean.respVar,   split=c(2, 2, 2, 2), more=FALSE)
# }
# 
# plot.disp <- plot(
#     x=isoscape,
#     which="disp",
#     borders=list(borders=worldcountries),
#     mask=list(mask=oceanmask),
#     palette=isoscapepalette,
#     plot=FALSE)
# 
# plot.disp.predVar <- plot(
#     x=isoscape,
#     which="disp.predVar",
#     borders=list(borders=worldcountries),
#     mask=list(mask=oceanmask),
#     palette=isoscapepalette,
#     plot=FALSE)
# 
# plot.disp.residVar <- plot(
#     x=isoscape,
#     which="disp.residVar",
#     borders=list(borders=worldcountries),
#     mask=list(mask=oceanmask),
#     palette=isoscapepalette,
#     plot=FALSE)
#     
# plot.disp.respVar <- plot(
#     x=isoscape,
#     which="disp.respVar",
#     borders=list(borders=worldcountries),
#     mask=list(mask=oceanmask),
#     palette=isoscapepalette,
#     plot=FALSE)
# 
# if(require(lattice)) {
#     print(plot.disp, split=c(1, 1, 2, 2), more=TRUE)
#     print(plot.disp.predVar,   split=c(2, 1, 2, 2), more=TRUE)
#     print(plot.disp.residVar,  split=c(1, 2, 2, 2), more=TRUE)
#     print(plot.disp.respVar,   split=c(2, 2, 2, 2), more=FALSE)
# }
# 
# ## End(Not run)

Run the code above in your browser using DataLab