plotMCMC: Plot STRUCTURE MCMC chains

Description Usage Arguments Value Examples

Description

Plot non-burn MCMC iterations of STRUCTURE for checking convergence. If plot is set to FALSE a data.frame is returned containing the log likelihood and alpha values over different K and runs and not plot is printed to the device.

Usage

1
plotMCMC(x, plot = TRUE, use_logL = TRUE, facet = TRUE)

Arguments

x

structList objects or a struct object

plot

logical print resulting plot default TRUE

use_logL

logical plot log-likelihood (TRUE) or admixture coefficient

facet

logical facet by K default TRUE

Value

If plot is TRUE a ggplot is printed to the screen and the plot object and the data to generate it are returned. Otherwise, a data.frame containing MCMC info it returned.

Examples

1
2
3
4
5
#Read in Structure files
multiple_runs_k10 <- exampleStructure("mcmc_diagnostics")
print(multiple_runs_k10)
results <- plotMCMC(multiple_runs_k10, plot = TRUE)
single_run <- plotMCMC(multiple_runs_k10[[1]])

Example output

structList object containing 10  STRUCTURE runs.
Number of Ks by number of runs:
10 
10 

starmie documentation built on May 1, 2019, 8:01 p.m.