Description Usage Arguments Value Author(s) Examples
View source: R/aggregate_specs_list.r
Aggregates a list of outputs from specificity::phy_or_env_spec() into a single data.frame object. Can also include feature data (e.g. species taxonomy) into that output. Output can also be byFeature, with one row per feature, and multiple columns for different variables.
1 | aggregate_specs_list(sl, byFeature = FALSE, fd = NULL, fd_id = 1)
|
sl |
specs_list. A named list of outputs from phy_or_env_spec. See examples. |
byFeature |
bool. If true, each feature will occupy only one row, with multiple columns to represent the different variables in specs_list (default: FALSE) |
fd |
data.frame. Optional feature data - a data.frame object with one row per feature, including some column with feature IDs that includes feature IDs in sl as rownames (default:NULL) |
fd_id |
integer or string. If integer, specifies the column index of fd that contains feature ids. If character, specifies the column name (default: 1). |
a data.frame object.
John L. Darcy
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | # attach(antarctica)
# # to see details of the antarctica data set, see ?antarctica
# # aggregate data long format:
# ant_long <- aggregate_specs_list(antarctica_specs_list, byFeature=FALSE,
# fd=antarctica_taxonomy, fd_id=1)
# head(ant_long)
# ant_wide <- aggregate_specs_list(antarctica_specs_list, byFeature=TRUE,
# fd=antarctica_taxonomy, fd_id=1)
# head(ant_wide)
# # aggregation can also be done without feature data (fd):
# ant_long <- aggregate_specs_list(antarctica_specs_list, byFeature=FALSE)
# head(ant_long)
# ant_wide <- aggregate_specs_list(antarctica_specs_list, byFeature=TRUE)
# head(ant_wide)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.