dots_to_dsts: Convert Distributions in Ellipsis to List

View source: R/dots_to_dsts.R

dots_to_dstsR Documentation

Convert Distributions in Ellipsis to List

Description

Flattens distributions placed in an ellipsis argument into a list, so that the ellipsis can include distributions themselves and lists of distributions.

Usage

dots_to_dsts(..., na.rm = FALSE)

Arguments

...

Distribution objects, possibly also lists of distributions.

na.rm

Logical; remove NA entries? Note that NULL entries are always removed.

Details

An error is thrown if, after discarding NULL entries, ... contains non-distributions. This function is essentially a wrapper around rlang::flatten().

Value

A list of distributions contained in the ..., with NULL entries discarded. If no distributions are present, returns list().

Examples

d <- dst_norm(0, 1)
distplyr:::dots_to_dsts(d, list(d, d), NULL)

vincenzocoia/distplyr documentation built on March 5, 2024, 9:45 p.m.