Learn R Programming

EMC2 (version 2.1.0)

subset.emc: Shorten an emc object

Description

Shorten an emc object

Usage

# S3 method for emc
subset(
  x,
  stage = "sample",
  filter = NULL,
  thin = 1,
  keep_stages = FALSE,
  length.out = NULL,
  ...
)

Value

A shortened emc object

Arguments

x

an emc object

stage

A character string. Indicates from which sampling stage(s) to take the samples from (i.e. preburn, burn, adapt, sample)

filter

Integer or numeric vector. If an integer is supplied, iterations up until that integer are removed. If a vector is supplied, the iterations within the range are kept.

thin

An integer. By how much to thin the chains

keep_stages

Boolean. If TRUE, will not remove samples from unselected stages.

length.out

Integer. Alternatively to thinning, you can also select a desired length of the MCMC chains, which will be thinned appropriately.

...

additional optional arguments

Examples

Run this code
subset(samples_LNR, length.out = 10)

Run the code above in your browser using DataLab