phylo4d-hasData {phylobase}R Documentation

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

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

Arguments

x a phylo4d object

Details

The outcome of the test is based on row names of the data frame stored in data. If there are no rows having row names from the set nodeId(x, "tip"), then hasTipData returns FALSE. Likewise, if there are no rows having row names from the set nodeId(x, "internal"), then hasNodeData returns FALSE.

Value

logical return TRUE or FALSE depending whether data are associated with the tree (i.e., the slots tip.data or node.data are not empty)

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 constructor and phylo4d class.

Examples

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

[Package phylobase version 0.5 Index]