Learn R Programming

Rsampletrees (version 0.1)

plot.treeoutput: Plot selected output of a sampletrees run

Description

This function produces the following plots:

1) Barchart giving the acceptance proportions for each update type

2) Traceplot of mutation rate (theta)

3) Traceplot of recombination rate (rho)

If tree statistics have been computed on the sampled trees, traceplots of the tree statistics will also be produced.

Usage

"plot"(x, oneperpage = FALSE, asktoplot = FALSE, layoutmat = NULL, statnames = NULL, ...)

Arguments

x
An object of class `treeoutput' containing the settings and output from a sampletrees run
oneperpage
Only one plot per page (Optional)
asktoplot
Plots are printed to screen after hitting enter (Optional)
layoutmat
A matrix giving the layout for the plots on the page. This is passed to the layout() function (Optional)
statnames
Names for the tree statistics for plotting.
...
Other arguments to be passed to plot.

Value

The three or more plots are plotted in the graphics window.

Details

The acceptance proportions for update types 1,2, and 4-7 are the number of accepted changes divided by the number of times a given update was performed. Update type 3 proposes changes to each node of the tree in turn. The acceptance proportion for update type 3 is therefore the average of the proportion of nodes that have an update accepted.

References

TBD

See Also

layout

Examples

Run this code

mrca.age=function(tree)
{
	return(coalescent.intervals(tree)$total.depth)
}

filename=system.file("Examples/example_g_pars", package="Rsampletrees")
runpars=readArgs(filename, check=FALSE)

# Must change the path so that the output can be found
runname=paste(system.file(package="Rsampletrees"),runpars$RunName, sep="/")
runpars=changeArgs(runpars, RunName=runname)

# Read in the output
results=readOutput(argob=runpars)

# Plot the output
plot(results)
plot(results, layoutmat=matrix(c(1,1,2,3),byrow=TRUE,nrow=2))
plot(results, oneperpage=TRUE, asktoplot=TRUE)

# Add a tree statistic
results=addTreeStat(results, myfunc=mrca.age, funcname="Time to MRCA")
plot(results)

Run the code above in your browser using DataLab