Learn R Programming

nichetools (version 0.3.2)

extract_sigma: extract \(\Sigma\)

Description

Extract Bayesian estimates of \(\Sigma\) from data objects created by nicheROVER or SIBER.

Usage

extract_sigma(
  data,
  pkg = NULL,
  isotope_n = NULL,
  isotope_names = NULL,
  data_format = NULL
)

Value

Returns a tibble of extracted estimates of \(\Sigma\) created by the function niw.post() or siberMVN() in the packages nicheROVER. and SIBER.

The returned object will contain five columns in the following order when data_format is set to "wide", metric, id, sample_name, isotope, sample_number, and the posterior sample for \(\Sigma\) (e.g., d13c and d15n).

Arguments

data

a list created by the function niw.post() or siberMVN() in the package nicheROVER or SIBER, respectfully.

pkg

a character string that is the name of the package that you're using. Defaults to "nicheROVER". Alternatively the user can supply the argument with "SIBER".

isotope_n

a numeric either 2 or 3 that is the number of isotopes used in the anlsysis. Will default to 2.

isotope_names

is a vector of character string used change the column name of isotopes used in the analysis. Defaults to c("d13c", "d15n").

data_format

a character string that decides whether the returned object is in long or wide format. Default is "wide", with the alternative supplied being "long".

See Also

nicheROVER::niw.post() and SIBER::siberMVN()

Examples

Run this code
extract_sigma(
data = niw_fish_post
)

extract_sigma(
data = post_sam_siber,
pkg = "SIBER"
)

Run the code above in your browser using DataLab