read.mulTree | R Documentation |
Reads MCMCglmm objects from the mulTree
function back into the R
environment.
read.mulTree(mulTree.chain, convergence = FALSE, model = FALSE, extract = NULL)
mulTree.chain |
A chain name of |
convergence |
Logical, whether to read the convergence file associated with the chain name (default = |
model |
Logical, whether to input a single |
extract |
Optional, the name of one or more elements to extract from each model (rather than loading the full model; default = |
The argument model = TRUE
can be used to load the MCMCglmm
object of a unique chain.
The resulting object can be then summarized or plotted as S3 method for class MCMCglmm
.
A list
of the terms of class mulTree
by default.
Else a MCMCglmm
object (if model = TRUE
); a gelman.diag
object (if convergence = TRUE
) or a list of extracted elements from the MCMCglmm
models (if extract
is not NULL
).
Thomas Guillerme
mulTree
, plot.mulTree
, summary.mulTree
## Creating some dummy mulTree models
data <- data.frame("sp.col" = LETTERS[1:5], var1 = rnorm(5), var2 = rnorm(5))
tree <- replicate(3, rcoal(5, tip.label = LETTERS[1:5]), simplify = FALSE)
class(tree) <- "multiPhylo"
mulTree.data <- as.mulTree(data, tree, taxa = "sp.col")
priors <- list(R = list(V = 1/2, nu = 0.002),
G = list(G1 = list(V = 1/2, nu = 0.002)))
mulTree(mulTree.data, formula = var1 ~ var2, parameters = c(10000, 10, 1000),
chains = 2, prior = priors, output = "quick_example", convergence = 1.1,
ESS = 100, verbose = FALSE)
## Reading all the models
all_chains <- read.mulTree("quick_example")
## Reading the convergence diagnosis for all the trees
read.mulTree("quick_example", convergence = TRUE)
## Reading a specific model
model <- read.mulTree("quick_example-tree1_chain1", model = TRUE)
## Reading only the error term and the tune for all models
read.mulTree("quick_example", extract=c("error.term", "Tune"))
##Remove the generated files from the current directory
file.remove(list.files(pattern = "quick_example"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.