gather_intervals: Gather 'ggdist::point_interval' summaries (i.e. long format)

Description Usage Arguments Details Value Examples

View source: R/gather_intervals.R

Description

Gather ggdist::point_interval summaries (i.e. long format).

Usage

1
2
3
4
5
6
7
gather_intervals(
  data,
  incl = c(".width", ".point", ".interval"),
  excl = "^.+__",
  fun = ggdist::mode_qi,
  ...
)

Arguments

data

ggdist::point_interval summaries.

incl

Summary variables to include in output.

excl

Regex pattern to exclude variables from output. Usually to exclude "*__" variables such as "lp__".

fun

ggdist::point_interval function such as mean_qi.

...

Extra arguments used by fun

Details

Take a summary from ggdist::point_interval and put it in long format with columns .variable and .code.value. Grouped variables will be kept just as the tidybayes::gather_variables() does it.

This function mimics the behavior of tidybayes::gather_variables(). The code is actually pretty much the same. See @R-tidybayes. ☻

Value

Point and interval summary in long format.

Examples

1
2
3
4
df <- rbind(
 data.frame(model = "alpha", a = runif(5), b = rnorm(5), c = rexp(5)),
 data.frame(model = "beta", a = runif(5), b = rnorm(5), c = rexp(5))
 )

FrankLef/eflStats documentation built on Dec. 17, 2021, 8:30 p.m.