getMCMCtrees: Managing List of Trees From MCMC

View source: R/coalescentMCMC.R

getMCMCtreesR Documentation

Managing List of Trees From MCMC


These functions help to manage trees output from MCMCs.

getMCMCtrees extracts the trees from previous MCMC runs.

saveMCMCtrees saves the lists of trees from previous runs on the user's hard disk.

cleanMCMCtrees deletes the lists of trees from previous runs (the files possibly on the hard disk are not changed).

getLastTree extracts the last tree from a list of trees (object of class "multiPhylo").

getMCMCstats returns the summary data for the different chains run during a session.


getMCMCtrees(chain = NULL)
saveMCMCtrees(destdir = ".", format = "RDS", ...)



an integer giving which lists of trees to extract


a character string giving the location where to save the files; by default, this is the current working directory.


the format of the tree files. Three choices are possible (cae-insensitive): "RDS", "Newick", "NEXUS", or any unambiguous abbreviation of these.


options passed to the function used to write the tree files (see below) or passed to other methods.


an bject of class "multiPhylo".


The list of trees is returned in a specific environment and can be extracted with getMCMCtrees.

saveMCMCtrees saves the files with, by default, the RDS format using saveRDS. If format = "Newick", write.tree is used.; if format = "NEXUS", is used. Options can be passed to any of these functions with ....

getLastTree(X) is a short-cut to X[[length(X)]].

Most functions from the package coda can also be used to analyse the MCMC outputs.


getLastTree returns an object of class "phylo".

getMCMCstats returns a data frame.


Emmanuel Paradis

See Also

coalescentMCMC, treeOperators, subset.coalescentMCMC

coalescentMCMC documentation built on April 22, 2022, 5:05 p.m.