load_mix_data {MixSIAR} | R Documentation |
Load mixture data
Description
load_mix_data
loads the mixture data file and names the biotracers and
any Fixed, Random, or Continuous Effects.
Usage
load_mix_data(
filename,
iso_names,
factors,
fac_random,
fac_nested,
cont_effects
)
Arguments
filename |
csv file with the mixture/consumer data |
iso_names |
vector of isotope column headings in 'filename' |
factors |
vector of random/fixed effect column headings in 'filename'. NULL if no factors. |
fac_random |
vector of TRUE/FALSE, TRUE if factor is random effect, FALSE if fixed effect. NULL if no factors. |
fac_nested |
vector of TRUE/FALSE, TRUE if factor is nested within the other. Only applies if 2 factors. NULL otherwise. |
cont_effects |
vector of continuous effect column headings in 'filename' |
Value
mix
, a list including:
-
mix$data
: dataframe, raw mix/consumer data (all columns in 'filename'), -
mix$data_iso
: matrix, mix/consumer biotracer/isotope values (those specified in 'iso_names'), -
mix$n.iso
: integer, number of biotracers/isotopes, -
mix$n.re
: integer, number of random effects, -
mix$n.ce
: integer, number of continuous effects, -
mix$FAC
: list of fixed/random effect values, each of which contains:-
values
: factor, values of the effect for each mix/consumer point -
levels
: numeric vector, total number of values -
labels
: character vector, names for each factor level -
lookup
: numeric vector, if 2 factors and Factor.2 is nested within Factor.1, stores Factor.1 values for each level of Factor.2 (e.g. Wolf Ex has 8 Packs in 3 Regions, andmix$FAC[[2]]$lookup = c(1,1,1,2,2,2,2,3)
, the Regions each Pack belongs to). -
re
: T/F, is the factor a Random Effect? (FALSE = Fixed Effect) -
name
: character, name of the factor (e.g. "Region")
-
-
mix$CE
: list of lengthn.ce
, contains thecont_effects
values centered (subtract the mean) and scaled (divide by SD) -
mix$CE_orig
: list of lengthn.ce
, contains the original (unscaled)cont_effects
values -
mix$CE_center
: vector of lengthn.ce
, means of eachcont_effects
-
mix$CE_scale
: vector of lengthn.ce
, SD of eachcont_effects
-
mix$cont_effects
: vector of lengthn.ce
, names of eachcont_effects
-
mix$MU_names
: vector of biotracer/iso MEAN column headings to look for in the source and discrimination files (e.g. 'd13C' iniso_names
, 'Meand13C' here) -
mix$SIG_names
: vector of biotracer/iso SD column headings to look for in the source and discrimination files (e.g. 'd13C' iniso_names
, 'SDd13C' here) -
mix$iso_names
: vector of isotope column headings in 'filename' (same as input) -
mix$N
: integer, number of mix/consumer data points -
mix$n.fe
: integer, number of Fixed Effects -
mix$n.effects
: integer, number of Fixed Effects + Random Effects -
mix$factors
: vector of lengthn.effects
, names of the Fixed and Random Effects -
mix$fac_random
: T/F vector of lengthn.effects
indicating which effects are Random (= TRUE) and Fixed (= FALSE) -
mix$fac_nested
: T/F vector of lengthn.effects
indicating which effects are nested within the other, if any -
mix$fere
: TRUE if there are 2 Fixed Effects or 1 Fixed Effect and 1 Random Effect, FALSE otherwise. Used bywrite_JAGS_model
.
If no biotracer/isotope columns are specified, a WARNING prompts the user to select 2, 1, or 0.
If more than 2 Fixed/Random Effects are selected, a WARNING prompts the user to select 2, 1, or 0.
If more than 1 Continuous Effect is selected, a WARNING prompts the user to select 1 or 0.