Learn R Programming

phylobase (version 0.6.8)

tdata: Retrieving or updating tip and node data in phylo4d objects

Description

Methods to retrieve or update tip, node or all data associated with a phylogenetic tree stored as a phylo4d object

Usage

## S3 method for class 'phylo4d':
tdata(x, type=c("all", "tip", "internal"),
    label.type=c("row.names", "column"), empty.columns=TRUE)
  ## S3 method for class 'phylo4d,ANY':
tdata(x, type=c("all", "tip", "internal"),
    merge.data=TRUE, clear.all=FALSE, ...) <- value
  ## S3 method for class 'phylo4d':
tipData(x, \dots)
  ## S3 method for class 'phylo4d,ANY':
tipData(x, \dots) <- value
  ## S3 method for class 'phylo4d':
nodeData(x, \dots)
  ## S3 method for class 'phylo4d,ANY':
nodeData(x, \dots) <- value

Arguments

x
A phylo4d object
type
The type of data to retrieve or update: all (default) for data associated with both tip and internal nodes, tip for data associated with tips only, internal
label.type
How should the tip/node labels from the tree be returned? row.names returns them as row names of the data frame, column returns them in the first column of the data frame. This
empty.columns
Should columns filled with NA be returned?
merge.data
if tip or internal node data are provided and data already exists for the other type, this determines whether columns with common names will be merged together (default TRUE). If FALSE, columns with common names will be preserved separat
clear.all
If only tip or internal node data are to be replaced, should data of the other type be dropped?
...
For the tipData and nodeData accessors, further arguments to be used by tdata. For the replacement forms, further arguments to be used by formatData (e.g. match.data), see form
value
a data frame (or object to be coerced to one) to replace the values associated with the nodes specified by the argument type

Value

  • tdata returns a data frame

See Also

phylo4d

Examples

Run this code
data(geospiza)
   tdata(geospiza)
   tipData(geospiza) <- 1:nTips(geospiza)
   tdata(geospiza)
   data(geospiza)

Run the code above in your browser using DataLab