This method adds a dummy tip at the present (t = 0) to fully extinct trees with offsets, in order to have correct ages (otherwise the most recent tip is assumed to be at 0). This is a workaround to get the proper ages of the trees into other tools such as TreeAnnotator.

## Usage

offset.to.dummy.metadata(
trees.file,
log.file,
output.file = NULL,
dummy.name = "dummy"
)

## Arguments

trees.file

path to BEAST2 output file containing posterior trees

log.file

path to BEAST2 trace log file containing offset values

output.file

path to file to write converted trees. If NULL (default), trees are simply returned.

dummy.name

name of the added dummy tip, default dummy.

## Value

list of converted trees (as treedata)

offset.to.dummy() (faster version discarding metadata)

## Examples

# Convert trees with offset to trees with dummy tip
trees_file <- system.file("extdata", "ex_offset.trees", package = "EvoPhylo")
log_file <- system.file("extdata", "ex_offset.log", package = "EvoPhylo")