niche_ellipse {nichetools}R Documentation

Create ellipses based on Bayesian estimates of \mu and \Sigma

Description

This function allows the user to supply Bayesian estimates of \mu and \Sigma to create estimated Bayesian ellipse for niche region.

Usage

niche_ellipse(
  dat_mu,
  dat_sigma,
  isotope_a = NULL,
  isotope_b = NULL,
  p_ell = NULL,
  random = NULL,
  set_seed = NULL,
  n = NULL,
  message = TRUE
)

Arguments

dat_mu

a data.frame containing \mu Bayesian estimates. This data.frame needs to be in long format with each \mu estimate for each isotope stacked on top of each other. This can be produced using extract_mu().

dat_sigma

a data.frame containing \Sigma Bayesian estimates. This data.frame needs be in wide format, that is \Sigma (covariance) matrices stacked on top of each other. See example of how to convert to wide format. This can be produced using extract_sigma().

isotope_a

character string that is the column name of the first isotope used in dat_sigma. Defaults to "d13c".

isotope_b

character string that is the column name of the second isotope used in dat_sigma. Defaults to "d15n".

p_ell

is the confidence interval of each ellipse estimate. Default is 0.95 (i.e., 95% confidence interval). This value is bound by 0 and 1 and has to be a numeric.

random

logical value indicating whether or not to randomly sample posterior distributions for \mu and \Sigma to create a sub-sample of ellipse. Default is TRUE.

set_seed

numerical value to set seed for random sampling. Default is a random value. To consistently sample the same subsample, please supply a numerical value (e.g., 4). It is highly suggested to use set_seed to make the function results when randomly sampling reproducible.

n

numerical value that controls the number of random samples. Default is 10.

message

control whether the time processing is displayed after the end of the function. Default is TRUE.

Value

A tibble containing, sample_name, sample_number, and the isotopes that were used in the estimation of ellipse (i.e., and d13c and d15n).

See Also

nicheROVER::niw.post(), SIBER::siberMVN(), extract_mu(), and extract_sigma()

Examples

niche_ellipse(dat_mu = mu_est_long,
              dat_sigma = sigma_est_wide)

[Package nichetools version 0.2.0 Index]