Learn R Programming

starmie (version 0.1.2)

plotMCMC: Plot STRUCTURE MCMC chains

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

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

Run this code
#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]])

Run the code above in your browser using DataLab