| read.p4d {phylosignal} | R Documentation |
Read a phylo4d object from files
Description
This function creates an object of class phylo4d by combining
a phylogenetic tree and its associated tips data stored in two distinct files.
Usage
read.p4d(phylo.file, data.file, phylo.format = "newick", data.format = "table")
Arguments
phylo.file |
the name of the file which the phylogenetic tree is to be read from. |
data.file |
the name of the file which the tips data are to be read from. |
phylo.format |
the format of the phylogenetic tree provided.
Possible formats are " |
data.format |
the format of the table with tips data.
Possible formats are " |
Details
phylo.file and data.file can be provided as objects of mode character
or double-quoted strings.
The phylogenetic tree can be imported in two formats.
The
newickformat refers to the simple parenthetic format known as the Newick or New Hampshire format. The tree is read by calling the functionread.treeof the ape package.The
nexusformat refers to NEXUS format. The tree is read by calling the functionread.nexusof the ape package.
Tips data are imported from a table formatted file. The different formats allow to use
different separator and decimal characters.
They correspond to the variants of read.table:
-
tableuseread.tablewith default settings. -
csvuseread.csvwith default settings. -
csv2useread.csv2with default settings. -
delimuseread.delimwith default settings. -
delim2useread.delim2with default settings.
Value
An object of class phylo4d.
See Also
phylo4d to create a phylo4d object.