Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

phylo4d-accessors

Tests for presence of data associated with trees stored as phylo4d objects


Description

Methods that test for the presence of data associated with trees stored as phylo4d objects.

Usage

hasTipData(x)

## S4 method for signature 'phylo4d'
hasTipData(x)

hasNodeData(x)

## S4 method for signature 'phylo4d'
hasNodeData(x)

nData(x)

## S4 method for signature 'phylo4d'
nData(x)

Arguments

x

a phylo4d object

Details

nData tests for the presence of data associated with the object.

hasTipData and hasNodeData tests for the presence of data associated with the tips and the internal nodes respectively. The outcome of the test is based on row names of the data frame stored in the data slot. If no rows have names from the set nodeId(x, "tip"), then hasTipData returns FALSE. Likewise, if no rows have names from the set nodeId(x, "internal"), then hasNodeData returns FALSE.

Value

nData

returns the number of datasets (i.e., columns) associated with the object.

hasTipData, hasNodeData

return TRUE or FALSE depending whether data associated with the tree are associated with either tips or internal nodes respectively.

Methods

hasNodeData

signature(object = "phylo4d"): whether tree has internal node data

hasTipData

signature(object = "phylo4d"): whether tree has data associated with its tips

Author(s)

Ben Bolker, Thibault Jombart, Francois Michonneau

See Also

phylo4d-methods constructor and phylo4d class.

Examples

data(geospiza)
  nData(geospiza)       ## 5
  hasTipData(geospiza)  ## TRUE
  hasNodeData(geospiza) ## FALSE

phylobase

Base Package for Phylogenetic Structures and Comparative Data

v0.8.10
GPL (>= 2)
Authors
R Hackathon et al. (alphabetically: Ben Bolker, Marguerite Butler, Peter Cowan, Damien de Vienne, Dirk Eddelbuettel, Mark Holder, Thibaut Jombart, Steve Kembel, Francois Michonneau, David Orme, Brian O'Meara, Emmanuel Paradis, Jim Regetz, Derrick Zwickl)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.