Learn R Programming

coalescentMCMC (version 0.4-4)

subset.coalescentMCMC: Subset MCMC Output

Description

This function helps to manipulate outputs from coalescentMCMC, particularly it sets the attributes correctly (unlike if you would use [).

Usage

# S3 method for coalescentMCMC
subset(x, burnin = 1000, thinning = 10, end = NULL, ...)

Arguments

x

an object of class "coalescentMCMC".

burnin

an integer: the number of generations to drop.

thinning

an integer: the sampling frequency.

end

an integer: the generations after end are removed.

(unused)

Value

an object of class "coalescentMCMC".

Details

This function has more or less the same effect than the standard indexing operator ([). The main difference is that the attributes attached to the output from coalescentMCMC are not lost.

The options end may help to focus on one part of the MCMC (see examples).

See Also

acfplot, effectiveSize

Examples

Run this code
# NOT RUN {
data(woodmouse)
res <- coalescentMCMC(woodmouse, 1e6, moves = c(1, 3)) # ~ 1 hr
plot(res) # surely hard to read
plot(subset(res, end = 1e3)) # plot only the first 1000 generations

acfplot(res)
acfplot(subset(res, 1e4, 100))
# }

Run the code above in your browser using DataLab