Learn R Programming

Rphylopars (version 0.2.9)

write.phylopars: Write data and tree files for Python phylopars compatability.

Description

Writes data and tree files for Python phylopars compatibility.

Usage

write.phylopars(trait_data, tree, data_file, tree_file, species_identifier = "species")

Arguments

trait_data
A data frame with one column per trait, as well as a column labeled "species" (with species names matching tips on the phylogeny). Each row corresponds to a single observation, and multiple observation for species are allowed. Missing data should be represented with NA.
tree
An object of class phylo
data_file
Desired path to write data file.
tree_file
Desired path to write tree file.
species_identifier
Title of species column in data file. Defaulted to "species"

References

Bruggeman J, Heringa J and Brandt BW. (2009) PhyloPars: estimation of missing parameter values using phylogeny. Nucleic Acids Research 37: W179-W184.

Examples

Run this code
# simulate data
sim_data <- simtraits(ntaxa = 15,ntraits = 4,nreps = 3,nmissing = 10)

write.phylopars(trait_data = sim_data$trait_data,tree = sim_data$tree,data_file = "data_path.txt",
tree_file = "tree_path.new")

Run the code above in your browser using DataLab