make.consInt: Make a 'consInt' object

View source: R/make.consInt.R

make.consIntR Documentation

Make a consInt object

Description

make.consInt welds together a data.frame with a phylo object to yield an object that can be analyzed for most analyses. The builder keeps the whole tree plus a tree subsetted to the table provided; and the whole table plus a table subsetted to the rows in the tree

Usage

make.consInt(phy, dat, matchCol = NA, imposeTidy = TRUE, ...)

Arguments

phy

a phylo object

dat

a data.frame object

matchCol

the column in dat to match to the tree; if not provided, make.consInt will use row names

imposeTidy

boolean – forces trees to match data using tidyName

...

extra parameters to pass to tidyName

Examples

### 1st block redundant with cleanPhylo example
data(malus_tr)
data(quercus_tr)
data(tilia_tr)
data(ulmus_tr)
malus2 <- cleanPhylo(malus, delim = '_|_')
quercus2 <- cleanPhylo(quercus)
tilia2 <- cleanPhylo(tilia)
ulmus2 <- ulmus
ulmus2$tip.label <- paste('Ulmus', ulmus2$tip.label)

### Not duplicated in cleanPhylo:
data(accessions.mor) # read MOR accessions data
data(desiderata.mor) # read MOR desiderata list
temp <- c(accessions.mor$Taxon, desiderata.mor$taxon_name) %>%
   unique %>% sort
dat.mor <- data.frame(inGarden = temp %in% accessions.mor$Taxon,
                      wanted = temp %in% desiderata.mor$taxon_name,
                      row.names = temp)
rm(temp)
combo.malus <- make.consInt(malus2, dat.mor)
combo.quercus <- make.consInt(quercus2, dat.mor)
# combo.tilia <- make.consInt(tilia2, dat.mor) ## duplicate somewhere
combo.ulmus <- make.consInt(ulmus2, dat.mor)


andrew-hipp/2021-pd-vs-ed documentation built on Jan. 29, 2023, 11:37 a.m.