View source: R/read.nexus.partitions.R
read.nexus.partitions | R Documentation |
read.nexus.partitions
reads in sequences in NEXUS format and splits
the data according to the charsets given in the SETS block.
read.nexus.partitions(file, return = "list", ...)
file |
a file name. |
return |
either returns a list where each element is a 'phyDat' object or an object of class 'multiphyDat' |
... |
Further arguments passed to or from other methods. |
a list where each element is a 'phyDat' object or an object of class 'multiphyDat'.
Klaus Schliep klaus.schliep@gmail.com
read.nexus.data
, read.phyDat
tree <- rtree(10)
dat <- simSeq(tree, l=24)
fcat <- function(..., file = zz) cat(..., file=file, sep="", append=TRUE)
zz <- tempfile(pattern="file", tmpdir=tempdir(), fileext=".nex")
write.phyDat(dat, file=zz, format="nexus")
fcat("BEGIN SETS;\n")
fcat(" Charset codon1 = 1-12/3;\n")
fcat(" Charset codon2 = 2-12/3;\n")
fcat(" Charset codon3 = 3-12/3;\n")
fcat(" Charset range = 16-18;\n")
fcat(" Charset range2 = 13-15 19-21;\n")
fcat(" Charset singles = 22 23 24;\n")
fcat("END;\n")
tmp <- read.nexus.partitions(zz)
tmp
unlink(zz)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.