trimToTaxaLevel: Trim a Tree to a Given Level

Description Usage Arguments Details Value Author(s) Examples

View source: R/trimToTaxaLevel.R

Description

This function will take a tree and either remove all nodes lower than the given level or will remove all nodes not of the given level.

Usage

1
2
	trimToTaxaLevel(data, level = "genus", eliminateParentNodes = FALSE, 
		trimBelow = NULL, split = ".")

Arguments

data

A data frame in which each column contains the rdp read counts for every taxa given in the row names.

level

The depth the tree will go down to (kingdom, phylum, class, order, family, genus, species, subspecies).

eliminateParentNodes

If 'TRUE' the data set returned will only contain rows at the level specified by 'myTaxaLevel'. If 'FALSE' the data set returned will contain all the nodes up to the level specified by 'myTaxaLevel'.

trimBelow

If 'NULL' the function will pull out only the data at the level specified by 'myTaxaLevel'. If 'TRUE' the function will remove all the levels below the specified level. If 'FALSE' the function will remove all the levels above the specified level.

split

This is the character that separates the taxa levels in the row names.

Details

Notes:

  1. For 'level' k, p, c, o, f, g, s and ss can be used in place of kingdom, phylum, class, order, family, genus, species and subspecies respectively.

  2. Numbers can also be used for 'level', with no maximum limit.

  3. The option to 'eliminateParentNodes' only works when 'trimBelow' is NULL.

Value

A new data set that has been trimmed to the level selected.

Author(s)

Berkley Shands, Patricio S. La Rosa, Elena Deych, William D. Shannon

Examples

1
2
3
4
	data(saliva)
	
	### Trims saliva to only contain the class level 
	salivaClass <- trimToTaxaLevel(saliva, "class", TRUE)

HMPTrees documentation built on May 2, 2019, 4:02 p.m.