Learn R Programming

nlist (version 0.1.1)

subset.nlists: Subset nlists Object

Description

Subsets an nlists object by its parameters, chains and iterations.

Usage

# S3 method for nlists
subset(x, chains = NULL, iters = NULL, pars = NULL, ...)

Arguments

x

An nlists object.

chains

An integer vector of chains.

iters

An integer vector of iterations.

pars

A character vector of parameter names.

...

Unused.

Value

An nlists object.

Details

It can also be used to reorder the parameters as well as duplicate chains and iterations.

Examples

Run this code
# NOT RUN {
nlists <- nlists(
  nlist(a = 1, y = 3, x = 1:4),
  nlist(a = 2, y = 4, x = 4:1),
  nlist(a = 3, y = 6, x = 5:2)
)
subset(nlists)
subset(nlists, pars = "a")
subset(nlists, pars = c("x", "a"))
subset(nlists, iters = 1L)
subset(nlists, iters = c(2L, 2L))
# }

Run the code above in your browser using DataLab