View source: R/completePhyloData.R
completePhyloData | R Documentation |
Return observations present in a data set and also in a phylogeny. Taxon name (e.g., species names) need to be present in the data frame provided. The data frame can contain multiple observations per taxon.
completePhyloData(
phylogeny = NULL,
dataset = NULL,
traits = NULL,
taxon_name = "animal"
)
phylogeny |
(phylo). Phylogeny with tip labels naming terminal taxa. |
dataset |
(dataframe). Data frame with a column representing the terminal taxon names equivalent to tip labels in phylogeny (e.g., species names if working at the species level) |
traits |
(character). Name of the variables of interest. Complete data for these columns will be returned. It is important that the traits specified match column names in the dataset. |
List containing a phylogeny and a data frame including the variables of interest with observations for these variables and also present in the phylogeny.
## Not run:
# Get phylogenetic and traits complete data for an example obtained simulating data
# Simulate example data
simulated_traits.data <- simulateDataSet()
# Get complete data and phylogeny
complete.data <- completePhyloData(
phylogeny = simulated_traits.data$phylogeny,
dataset = simulated_traits.data$data,
traits = colnames(simulated_traits.data$data),
taxon_name = "animal")
# Data frame with complete data for the specified traits
complete.data$dta
# Phylogeny for the complete data
complete.data$phylo
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.