filter: Filter duplicated characters in a nexus file

Description Usage Arguments Examples

View source: R/filter.R

Description

Given a list of specified duplicates, drop and/or merge characters

Usage

1
filter(x, dups = NULL)

Arguments

x

(required) a nexus input file

dups

an optional matrix or list specifying which character are duplicates (e.g., dups = list('1733' = c(1741,1745,1755)))

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
x <- read.nex(system.file("extdata", "clarke_2006.nex", package = "phenotools"))
y <- read.nex(system.file("extdata", "nesbitt_2015.nex", package = "phenotools"))
xy <- concat(list(x,y))
dups <- duplicated(xy, opt="terms")
# a pair of duplicate characters
xy[,c(144,345)]$charlab
# drop from dataset
xy2 <- filter(xy, cbind(144,345))
xy
xy2

## End(Not run)

celiason/phenotools documentation built on Sept. 12, 2019, 6:49 p.m.