Skip to contents

Get a lineages ancestors out of a fromDFtoNetwork()node network. Vector being TRUE supersedes table being TRUE. Default return node network. Nodes not found result in NULL, empty string, or empty df of levelName/level/attribute depending on output being network/vector/table

Usage

pullAncestors(
  x,
  node_name,
  table = FALSE,
  vector = FALSE,
  attribute = "lineage"
)

Arguments

x

node network produce by fromDFtoNetwork()

node_name

Lineage of interest ie. "BA.1"

table

logical, return subtree or dataframe of level/lineage

vector

logical, return vector of lineage names

attribute

character, metadata attribute to use for table/vector output, use "name" for levelName

Value

one of two options depending on table/vector params

  • a Node class network object of the nodes leading to node_name

  • a table from the node network with level and lineage names

  • a vector of lineage/node names