Learn R Programming

IsoriX (version 0.4-1)

Isorix: Infer spatial origins

Description

This function performs the assignment of organims of unknown origins.

Usage

Isorix( assign.data, isoscape, calibfit, mask=NULL, verbose=interactive() )

Arguments

assign.data
A dataframe containing the assignment data (see note below)
isoscape
The output of the function Isoscape
calibfit
The output of the function Calibfit
mask
A SpatialPolygons of a mask to replace values on all rasters by NA inside polygons (see details)
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 isorix containing itself three lists (indiv, group, and sp.points) storing all rasters built during assignment and the spatial points for sources and calibration. The list indiv contains three stack of rater layers: one storing the value of the test statistic ("stat"), one storing the value of the variance of the test statistic ("var") and one storing the p-value of the test ("pv"). The list group contains one rater storing the p-values of the assignment for the group. The list sp.points contains two spatial point objects: source.points and calib.points.

Details

An assignment is a comparison, for a given organism, of the predicted isotopic value at its location of origin and the predicted isotopic value at each location of the isoscape. The difference between these two values constitute the statistic of the assingment test. Under the null hypothesis (when the organism is at a location with the same isotopic value than its original location), the test statistics follows a normal distribution with mean zero and a certain variance that stems from both the isoscape model fits and the calibration fit. The function Isorix computes the map of p-value for such assignment test (i.e. the p-values in all locations of the isoscape) for all individual in the dataframe assign.data. The function also perform a single assignment for the entire group by combining the individual p-value maps using the Fisher's method (Fisher 1925).

A mask can be used so to remove all values falling in the mask. This can be useful for performing for example assignments on lands only and discarded anything falling in large bodies of water (see example).

References

Fisher, R.A. (1925). Statistical Methods for Research Workers. Oliver and Boyd (Edinburgh). ISBN 0-05-002170-2.

See Also

IsoriX for the complete workflow

Examples

Run this code
## Not run: 
# ## The following example takes some time and will therefore not
# ## be run unless you type: example(Isorix, run.dontrun=TRUE)
# 
# data(calibrationdata)
# data(assignmentdata)
# data(elevationrastersmall)
# data(worldcountries)
# data(oceanmask)
# data(GNIP_Model)
# 
# ## prepare the elevation raster
# elevationraster <- RElevate(
#     elevation.raster=elevationrastersmall,
#     isofit=GNIP_Model)
# 
# ## build the isoscape
# isoscape <- Isoscape(
#     elevation.raster=elevationraster,
#     isofit=GNIP_Model)
# 
# ## fit the calibration model
# calib <- Calibfit(
#     calib.data=calibrationdata,
#     isofit=GNIP_Model)
# 
# 
# ## perform the assignment on land and water
# assignment <- Isorix(
#     assign.data=subset(assignmentdata,
#       species=="Myotis_bechsteinii"),
#     isoscape=isoscape,
#     calibfit=calib)
# 
# assignment
# 
# 
# ## perform the assignment on land only
# assignment.dry <- Isorix(
#     assign.data=subset(assignmentdata,
#       species=="Myotis_bechsteinii"),
#     isoscape=isoscape,
#     calibfit=calib,
#     mask=oceanmask)
# 
# ## plot the group assignment
# plot(assignment, who="group") ## without decoration
# 
# plot(assignment.dry, who="group") ## without decoration
# 
# plot(assignment.dry, who="group",
#   borders=list(borders=worldcountries),
#   mask=list(mask=oceanmask))
# 
# ## plot the assignment for the 4 first individuals
# plot(assignment.dry, who=1:4,
#   borders=list(borders=worldcountries),
#   mask=list(mask=oceanmask),
#   sources=list(draw=FALSE),
#   calib=  list(draw=FALSE))
# 
# ## plot the assignment for the individual "Mbe_8"
# plot(assignment.dry, who="Mbe_8",
#   borders=list(borders=worldcountries),
#   mask=list(mask=oceanmask))
# 
# ## End(Not run)

Run the code above in your browser using DataLab