aggregate.nlists: Aggregate nlists

Description Usage Arguments Value Examples

View source: R/aggregate.R

Description

Aggregates an nlists_object() into a nlist_object() or by_chain = TRUE an nlists_object() with nchains nlist_object()s.

Usage

1
2
## S3 method for class 'nlists'
aggregate(x, fun = mean, ..., by_chain = FALSE)

Arguments

x

An nlist object.

fun

A function that given a numeric vector returns a numeric scalar.

...

Additional arguments passed to fun.

by_chain

A flag specifying whether to aggregate by chains.

Value

An nlist object if by_chain = FALSE otherwise an nlists object.

Examples

1
aggregate(nlists(nlist(x = 1:3), nlist(x = 2:4)))

nlist documentation built on Feb. 7, 2021, 1:07 a.m.