R/treetime.R

Defines functions read.timetree read.treetime

Documented in read.timetree read.treetime

##' read timetree output
##'
##' @rdname treetime
##' @title read.timetree
##' @param file the output tree file of timetree
##' @return treedata object
##' @export
read.treetime <- function(file) {
    con <- readLines(file)
    con <- sub("(\\[)\\\\\\[(.*)\\\\\\](\\])", "\\1\\2\\3", con) 

    f <- tempfile()
    writeLines(con, f)
    x <- read.beast(f)
    x@file <- file
    return(x)
}

##' @rdname treetime
read.timetree <- function(file) {
    message("Please use `read.treetime() instead. The `read.timetree()` function may be removed in future version.\n")
    read.treetime(file)
}
GuangchuangYu/treeio documentation built on Oct. 31, 2024, 10:13 a.m.