extract_mu {nichetools} | R Documentation |
\mu
Extract Bayesian estimates of \mu
from data objects created by
nicheROVER or
SIBER.
extract_mu(
data,
pkg = NULL,
isotope_names = NULL,
data_format = NULL,
community_df = NULL
)
data |
a |
pkg |
a |
isotope_names |
is a vector of |
data_format |
a |
community_df |
a four column data frame. One of the columns has to be named
|
Returns a tibble
of extracted estimates of \mu
created by the
function niw.post()
or siberMVN()
in the packages
nicheROVER.
and SIBER.
The tibble
will contain five columns in the following order, metric
,
sample_name
, sample_number
, and the names of the isotope
columns supplied to niw.post()
or siberMVN()
(e.g., d13c
and d15n
).
nicheROVER::niw.post()
and SIBER::siberMVN()
extract_mu(
data = niw_fish_post
)
library(SIBER)
# ---- create community names data frame ----
# uncomment to use
# str(demo.siber.data.2)
demo.siber.data.2$group_name <- as.factor(demo.siber.data.2$group)
demo.siber.data.2$group <- as.numeric(demo.siber.data.2$group_name) |>
as.character()
demo.siber.data.2$community_name <- as.factor(demo.siber.data.2$community)
demo.siber.data.2$community <- as.numeric(demo.siber.data.2$community_name) |>
as.character()
cg_name <- demo.siber.data.2 |>
dplyr::distinct(community, group, community_name, group_name)
extract_mu(
data = post_sam_siber,
pkg = "SIBER",
community_df = cg_name
)