drop.tip method

drop.tip method

drop.tip(object, tip, ...)

drop.tip(object, tip, ...)

# S4 method for phylo
drop.tip(object, tip, ...)

Source

drop.tip for phylo object is a wrapper method of ape::drop.tip from the ape package. The documentation you should read for the drop.tip function can be found here: drop.tip

Arguments

object

A treedata or phylo object

tip

a vector of mode numeric or character specifying the tips to delete

...

additional parameters

Value

updated object

See also

Author

Casey Dunn http://dunnlab.org and Guangchuang Yu https://guangchuangyu.github.io

Examples

nhxfile <- system.file("extdata/NHX", "ADH.nhx", package="treeio")
nhx <- read.nhx(nhxfile)
drop.tip(nhx, c("ADH2", "ADH1"))
#> 'treedata' S4 object that stored information
#> of
#> 	'/usr/local/lib/R/site-library/treeio/extdata/NHX/ADH.nhx'.
#> 
#> [email protected] phylo:
#> 
#> Phylogenetic tree with 4 tips and 3 internal nodes.
#> 
#> Tip labels:
#>   ADHY, ADHX, ADH4, ADH3
#> 
#> Rooted; includes branch lengths.
#> 
#> with the following features available:
#>   'B', 'D', 'S'.
#> 
#> # The associated data tibble abstraction: 7 × 6
#> # The 'node', 'label' and 'isTip' are from the phylo tree.
#>    node label isTip     B D     S       
#>   <int> <chr> <lgl> <dbl> <chr> <chr>   
#> 1     1 ADHY  TRUE     NA NA    nematode
#> 2     2 ADHX  TRUE     NA NA    insect  
#> 3     3 ADH4  TRUE     NA NA    yeast   
#> 4     4 ADH3  TRUE     NA NA    yeast   
#> 5     5 NA    FALSE    NA N     NA      
#> 6     6 NA    FALSE    NA N     metazoa 
#> 7     7 NA    FALSE    NA NA    Fungi