gather_intervals_rng: Gather 'ggdist::point_interval' with .point, .lower and...

Description Usage Arguments Details Value Examples

View source: R/gather_intervals.R

Description

Gather ggdist::point_interval with .point, .lower and .upper columns.

Usage

1
2
3
4
5
6
7
gather_intervals_rng(
  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. Also put the value in 3 columns: .point, .lower and .upper.

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 with 3 columns.

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.