ape (version 1.2-3)

drop.tip: Remove Tips in a Phylogenetic Tree

Description

This function removes the terminal branches of a phylogenetic tree, possibly removing the corresponding internal branches.

Usage

drop.tip(phy, tip, trim.internal = TRUE)

Arguments

phy
an object of class "phylo".
tip
a vector of mode character giving the tips to delete.
trim.internal
a logical specifying whether to delete the corresponding internal branches.

Value

  • an object of class "phylo".

Details

If trim.internal = FALSE, the new tips are given "NA" as labels, unless there are node labels in the tree in which case they are used.

See Also

bind.tree

Examples

Run this code
data(bird.families)
tip <- c(
"Eopsaltriidae", "Acanthisittidae", "Pittidae", "Eurylaimidae",
"Philepittidae", "Tyrannidae", "Thamnophilidae", "Furnariidae",
"Formicariidae", "Conopophagidae", "Rhinocryptidae", "Climacteridae",
"Menuridae", "Ptilonorhynchidae", "Maluridae", "Meliphagidae",
"Pardalotidae", "Petroicidae", "Irenidae", "Orthonychidae",
"Pomatostomidae", "Laniidae", "Vireonidae", "Corvidae",
"Callaeatidae", "Picathartidae", "Bombycillidae", "Cinclidae",
"Muscicapidae", "Sturnidae", "Sittidae", "Certhiidae",
"Paridae", "Aegithalidae", "Hirundinidae", "Regulidae",
"Pycnonotidae", "Hypocoliidae", "Cisticolidae", "Zosteropidae",
"Sylviidae", "Alaudidae", "Nectariniidae", "Melanocharitidae",
"Paramythiidae","Passeridae", "Fringillidae")
plot(drop.tip(bird.families, tip))
plot(drop.tip(bird.families, tip, trim.internal = FALSE))

Run the code above in your browser using DataCamp Workspace