View source: R/prepare_invasible.R
| prepare_invasible | R Documentation |
Aligns species-level invasion data with a phylogeny and stores predictor information for downstream analyses.
prepare_invasible(
df,
tree = NULL,
predictors = NULL,
species_col = "Species",
rho = 0.5,
plot = FALSE
)
df |
Data frame containing at least a |
tree |
Optional object of class |
predictors |
Optional character vector of column names containing
additional predictors. If |
species_col |
Character string giving the name of the species column.
Defaults to |
rho |
Numeric value controlling the power parameter used for Grafen
branch lengths. Defaults to |
plot |
Logical. If |
If no phylogeny is supplied, a tree is retrieved from the Open Tree of Life using rotl. Unmatched species names are removed with a warning. When multiple submitted names resolve to the same Open Tree taxon, the first occurrence is retained and subsequent occurrences are removed with a warning.
If a supplied phylogeny has species that are absent from the data, those tips are removed. Species present in the data but absent from the phylogeny are removed from the data with a warning.
If branch lengths are absent, Grafen branch lengths are added.
An object of class "invasible_prepared" containing:
data: the aligned data frame;
tree: the aligned phylogeny;
predictors: the supplied predictor names.
## Not run:
prep <- prepare_invasible(
fish_beginning_with_E,
rho = 1,
predictors = c(
"Fake_categorical_trait",
"Fake_continuous_trait"
)
)
prep$tree
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.