addReplicatesOnTree: Add replicates to a tree

View source: R/addReplicatesOnTree.R

addReplicatesOnTreeR Documentation

Add replicates to a tree

Description

Utility function to add replicates to a tree, as tips with zero length branches.

Usage

addReplicatesOnTree(
  tree,
  traits,
  species = "species",
  id = "id",
  eps = .Machine$double.eps^2
)

Arguments

tree

A phylogenetic tree with n tips.

traits

A data frame containing at least two columns, one with sample ids, and on with species names for each samples.

species

Name of the column containing species names. Default to "species".

id

Name of the column containing samples ids. Default to "id".

eps

A small number to add to terminal branch lengths to avoid true zeros. Default to .Machine$double.eps.

Value

A phylogenetic tree with as many tips as the number of rows in traits, and clusters of tips with zero branch lengths corresponding to replicates.


pbastide/phylolimma documentation built on Nov. 17, 2024, 1:34 p.m.