read.p4d: Read a phylo4d object from files

Description Usage Arguments Details Value See Also

View source: R/readp4d.R


This function creates an object of class phylo4d by combining a phylogenetic tree and its associated tips data stored in two distinct files.


read.p4d(phylo.file, data.file, phylo.format = "newick",
  data.format = "table")



the name of the file which the phylogenetic tree is to be read from.


the name of the file which the tips data are to be read from.


the format of the phylogenetic tree provided. Possible formats are "newick" and "nexus".


the format of the table with tips data. Possible formats are "table", "csv", "csv2", "delim" and "delim2".


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 newick format refers to the simple parenthetic format known as the Newick or New Hampshire format. The tree is read by calling the function read.tree of the ape package.

  • The nexus format refers to NEXUS format. The tree is read by calling the function of 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:

  • table use read.table with default settings.

  • csv use read.csv with default settings.

  • csv2 use read.csv2 with default settings.

  • delim use read.delim with default settings.

  • delim2 use read.delim2 with default settings.


An object of class phylo4d.

See Also

phylo4d to create a phylo4d object.

phylosignal documentation built on May 19, 2017, 11:11 p.m.

Search within the phylosignal package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.