Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

make_conditions

Prepare Fully Crossed Conditions


Description

This is a helper function to prepare fully crossed conditions primarily for use with the conditions argument of conditional_effects. Automatically creates labels for each row in the cond__ column.

Usage

make_conditions(x, vars, ...)

Arguments

x

An R object from which to extract the variables that should be part of the conditions.

vars

Names of the variables that should be part of the conditions.

...

Arguments passed to rows2labels.

Details

For factor like variables, all levels are used as conditions. For numeric variables, mean + (-1:1) * SD are used as conditions.

Value

A data.frame where each row indicates a condition.

See Also

Examples

df <- data.frame(x = c("a", "b"), y = rnorm(10))
make_conditions(df, vars = c("x", "y"))

brms

Bayesian Regression Models using 'Stan'

v2.15.0
GPL-2
Authors
Paul-Christian Bürkner [aut, cre], Jonah Gabry [ctb], Sebastian Weber [ctb], Andrew Johnson [ctb], Martin Modrak [ctb]
Initial release
2021-03-10

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.