R/taxatree_models.R
taxatree_models.Rd
taxatree_models
runs tax_model
on every taxon at multiple taxonomic
ranks (you choose which ranks with the plural ranks
argument).
It returns the results as a named nested list of models
attached to a psExtra object.
One list per rank, one model per taxon at each rank.
The result can then be used with taxatree_models2stats
to extract a
dataframe of statistics for use with taxatree_plots
.
taxatree_models(
ps,
ranks = NULL,
type = "lm",
variables = NULL,
formula = NULL,
use_future = FALSE,
checkVars = TRUE,
checkNA = "warning",
verbose = "rank",
trans = "identity",
trans_args = list(),
...
)
phyloseq object or psExtra
vector of rank names at which to aggregate taxa for modelling
name of regression modelling function, or the function itself
vector of variable names, to be used as model formula right hand side. If variables is a list, not a vector, a model is fit for each entry in list.
Right hand side of a formula, as a formula object or character string. Or a list of these. (alternative to variables argument, do not provide both)
if TRUE parallel processing with future is possible, see details of ?tax_model.
check variance of variables?
check variables for NAs?
message about progress: "rank" only notifies which rank is being processed; TRUE notifies you about each taxon being processed; FALSE for no messages.
name of tax_transform transformation to apply to aggregated taxa before fitting statistical models
named list of any additional arguments to tax_transform e.g. list(zero_replace = "halfmin")
extra arguments are passed directly to modelling function
tax_model
for more details and examples
taxatree_plots
for how to plot the output of taxatree_models