Description Usage Arguments Value Details References Examples
View source: R/make_pred_sigs.R
make_pred_sigs
generates predator signatures based on a specified
predator diet composition and bootstrap sampling signatures from a prey
library.
1 | make_pred_sigs(prey_sigs, prey_loc, cc, diet, prey_ss, n_pred)
|
prey_sigs |
A matrix of prey signatures in the prey space, intended
to be the object |
prey_loc |
A matrix giving the first and last locations of the
signatures of each prey type within |
cc |
A numeric vector containing the calibration coefficients. |
diet |
A numeric vector specifying the predator diet composition as proportions. |
prey_ss |
An integer vector specifying the bootstrap sample size to use for each prey type. |
n_pred |
An integer specifying the number of predator signatures to generate. |
A list containing the following elements:
A numeric matrix containing simulated predator signatures in the predator space.
An integer error code (0 if no error is detected).
A string containing a brief summary of the results.
QFASA simulation studies often require the generation of predator signatures given a specified diet, against which subsequent estimates of diet composition can then be compared (e.g., Bromaghin et al. 2016). Given a specified diet, a bootstrap sample of each prey type is drawn and mean prey-type signatures are computed. A predator signature is then generated by multiplying the mean bootstrapped prey signatures by the diet proportions. Finally, the calibration coefficients are then used to transform the predator signatures to the predator space (Bromaghin et al. 2015).
Bromaghin, J.F., S.M. Budge, and G.W. Thiemann. 2016. Should fatty acid signature proportions sum to 1 for diet estimation? Ecological Research 31:597-606.
Bromaghin, J.F., K.D. Rode, S.M. Budge, and G.W. Thiemann. 2015. Distance measures and optimization spaces in quantitative fatty acid signature analysis. Ecology and Evolution 5:1249-1262.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | make_pred_sigs(prey_sigs = matrix(c(0.06, 0.09, 0.31, 0.54,
0.05, 0.09, 0.30, 0.56,
0.03, 0.10, 0.30, 0.57,
0.08, 0.07, 0.30, 0.55,
0.09, 0.05, 0.33, 0.53,
0.09, 0.06, 0.34, 0.51,
0.09, 0.07, 0.34, 0.50,
0.08, 0.11, 0.35, 0.46,
0.06, 0.14, 0.36, 0.44), ncol = 9),
prey_loc = matrix(c(1, 4, 7, 3, 6, 9), ncol=2),
cc = c(0.75, 1.05, 0.55, 1.75),
diet = c(0.25, 0.25, 0.50),
prey_ss = c(5, 3, 7),
n_pred = 50)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.