QA {assignR} | R Documentation |
Quality assessment of geographic assignments
Description
How well does a given isoscape and/or known origin data set constrain the geographic origin of samples? Uses iterative re-sampling of known origin data to evaluate sample assignments and reports a suite of quality metrics.
Usage
QA(known, isoscape, bySite = TRUE, valiStation = 1, valiTime = 50,
recal = TRUE, by = 2, prior = NULL, mask = NULL, setSeed = TRUE,
name = NULL)
Arguments
known |
subOrigData, list of subOrigData, or SpatVector. Known-origin tissue isotope data from the |
isoscape |
SpatRaster with two layers or |
bySite |
logical. Resample known by site (TRUE) or by sample (FALSE)? |
valiStation |
numeric. How many sites or samples from known are withheld for validation? Must be two or more smaller than the length of |
valiTime |
numeric. How many times do you want to randomly draw validation samples and run the validation? Must be an integer greater than one. |
recal |
logical. Recalibrate the isoscape(s) using the known-origin data? If FALSE, |
by |
integer. Threshold increment to use in evaluating assignment performance. Must be between 1 and 25. |
prior |
SpatRaster. Optional layer with prior probabilities, which has the same projection, resolution and extent as |
mask |
SpatVector. Constrains the area of the analysis. If this is not provided, the entire area of |
setSeed |
logical. Do you want to |
name |
character. Useful for identifying the QA output in subsequent plotting. |
Details
If known
is a user-provided SpatVector, the first data field must include the measured value for the first (or only) isotope marker and the second the one standard deviation uncertainty on that value. Subsequent fields must include the same information for all other isotope markers included in the analysis, and these markers must appear in the same order as in isoscape
. A user-provided SpatVector must include a field named “Site_ID” containing unique values for each sampling site to support the “bySite” option, otherwise use bySite = FALSE
.
Value
Returns an object of class “QA”.
val_stations |
numeric. An X*Y data.frame of validation station IDs for all valiTime. X = |
pd_val |
numeric. An X*Y data.frame containing the posterior probability density for the validation stations. X = |
prption_byArea |
numeric. An X*Y data.frame showing the proportion of validation individuals for which the known origin is contained within the top 0.00 to 1.00 area quantile (with increment of |
prption_byProb |
numeric. An X*Y data.frame showing the proportion of validation individuals for which the known origin is contained within the top 0.00 to 1.00 probability quantile (with increment of |
precision |
list. The length of the list is |
random_prob_density |
Random probability of assignment to any given grid cell on the assignment surface(i.e. 1 divided by the total number of grid cells). |
name |
character. Name assigned to the QA object. |
by |
integer. Value of by used. |
Note
See Ma et al. (2020) for methodological details.
References
Ma, C. et al. (2020) assignR : An R package for isotope-based geographic assignment. Methods in Ecology and Evolution 11 996–1001. doi:10.1111/2041-210X.13426.
Vander Zanden, H. B. et al. (2014) Contrasting assignment of migratory organisms to geographic origins using long-term versus year-specific precipitation isotope maps. Methods in Ecology and Evolution 5 891–900. doi:10.1111/2041-210X.12229
See Also
Examples
# extract some known-origin data
d1 = subOrigData(taxon = "Buteo lagopus")
# run quality assessment based on precipitation hydrogen isotopes and
# known-origin samples; small values of valiStation and valiTime
# are used in example to reduce run time
# first with one example
# gives warning because a small number of samples are available
qa1 = QA(known = d1, isoscape = d2h_lrNA, valiTime = 2, by = 10,
mask = naMap, name = "Buteo")
# plot the qa result
plot(qa1)
# now compare with a second data set
d2 = subOrigData(taxon = "Charadrius montanus")
qa2 = QA(known = d2, isoscape = d2h_lrNA, valiTime = 2, by = 10,
mask = naMap, name = "Charadrius")
plot(qa1, qa2)