Last data update: 2014.03.03

R: Plot the prior and posterior distribution of shifts
plotPriorR Documentation

Plot the prior and posterior distribution of shifts

Description

Generates a barplot of the prior and posterior distributions of the number of shifts.

Usage

plotPrior(mcmc, expectedNumberOfShifts = 1, burnin = 0.15,
  priorCol = "light blue", postCol = "red", legendPos = "topright", ...)

Arguments

mcmc

A dataframe of the mcmc_out file from a BAMM run, or the filename.

expectedNumberOfShifts

Expected number of shifts under the prior.

burnin

The fraction of samples to discard as burn-in.

priorCol

Color for the prior distribution.

postCol

Color for the posterior distribution.

legendPos

Placement of the legend, see legend.

...

Additional parameters that are passed to barplot.

Value

Invisibly returns a matrix with the probability of each shift number under the prior and the posterior.

Author(s)

Pascal Title

Examples

data(mcmc.whales)
plotPrior(mcmc.whales, expectedNumberOfShifts = 1, burnin = 0.15)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(BAMMtools)
Loading required package: ape
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/BAMMtools/plotPrior.Rd_%03d_medium.png", width=480, height=480)
> ### Name: plotPrior
> ### Title: Plot the prior and posterior distribution of shifts
> ### Aliases: plotPrior
> 
> ### ** Examples
> 
> data(mcmc.whales)
> plotPrior(mcmc.whales, expectedNumberOfShifts = 1, burnin = 0.15)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>