make_tapnet {tapnet} | R Documentation |
Constructs an object of type "tapnet"
Description
Collates networks, traits and phylogenies into a consistent data structure used for all other tapnet functions
Usage
make_tapnet(
tree_low,
tree_high,
networks,
abun_low = NULL,
abun_high = NULL,
traits_low = NULL,
traits_high = NULL,
npems_lat = NULL,
use.all.pems = FALSE
)
Arguments
tree_low |
phylogenetic tree of lower trophic level; required; |
tree_high |
phylogenetic tree of higher trophic level; required; |
networks |
a single or list of interaction network (as matrix); required; |
abun_low |
named abundance vector(s) for lower trophic level (single vector or list of vectors); optional; |
abun_high |
named abundance vector(s) for higher trophic level; optional; |
traits_low |
lower trophic level traits (species x traits matrix with row and column names); optional; |
traits_high |
higher trophic level traits (species x traits matrix with row and column names; optional; |
npems_lat |
number of phylogenetic eigenvectors to be used to construct latent traits. If NULL, all eigenvectors will be used. |
use.all.pems |
option to force the function to use all phylogenetic eigenvectors, not only those useful for describing the specific network's species. |
Details
Tapnet objects are the starting point for almost all other tapnet functions. They contain the information on the species and the (quantitative) interaction network data.
Value
A tapnet object, i.e. an thoroughly organised list with the inputs as entries. If multiple networks are provided, each has its own list entry, with PEMs, traits and abundances given for each network separately, in addition to the overall phylogenetic eigenvectors across all networks. See example for, well, for an example.
Author(s)
Gita Benadi <gita.benadi@biom.uni-freiburg.de>
References
Benadi et al. in prep
Examples
data(Tinoco)
tapnet_web1 <- make_tapnet(tree_low = plant_tree, tree_high = humm_tree, networks = networks[1],
traits_low = plant_traits, traits_high = humm_traits, npems_lat = 4)
str(tapnet_web1) # show tapnet structure