Skip to contents

These are functions which allow the user to execute parts or whole of the multiverse. The user can choose to either execute the default analysis using the execute_universe(), or the whole of the multiverse using the execute_multiverse().

Usage

execute_multiverse(multiverse, parallel = FALSE, progress = FALSE)

execute_universe(multiverse, .universe = 1, parallel = FALSE, progress = FALSE)

Arguments

multiverse

The multiverse object

parallel

Indicates whether to execute the multiverse analysis in parallel. If TRUE, multiverse makes use of future::future as backend to support parallel processing. Requires configuration of future::plan. Defaults to FALSE.

progress

Indicates whether to include a progress bar for each step of the execution. Defaults to FALSE.

.universe

Indicate which universe to execute, if the user wants to execute a specific combination of the parameters using execute_universe(). Defaults to NULL, which will execute the first (default) analysis.

Details

Each single analysis within the multiverse lives in a separate environment. We provide convenient functions to access the results for the default analysis, as well as parts or whole of the multiverse. Each analysis can also be accessed from the multiverse table, under the results column.

Examples

# \donttest{
library(dplyr)

M <- multiverse()

inside(M, {
  data <- rnorm(100, 50, 20)

  x.mean <- mean(data, trim = branch(
    trim_values,
    "trim_none" ~ 0,
    "trim_1pc" ~ 0.05,
    "trim_5pc" ~ 0.025,
    "trim_10pc" ~ 0.05
  ))
})

# Computes the analysis for all
# universes in the multiverse`
M %>%
  execute_multiverse()
# }