add_mutate_branch: Add mutate branches to a 'mverse' object.

View source: R/mutate_branch.R

add_mutate_branchR Documentation

Add mutate branches to a mverse object.

Description

This method adds one or more mutate branches to an existing mverse object. Mutate branches are used to define options for adding a new column to the analysis dataset.

Usage

add_mutate_branch(.mverse, ...)

Arguments

.mverse

a mverse object.

...

mutate_branch objects.

Value

The resulting mverse object.

See Also

Other mutate branch functions: mutate_branch

Examples

# Define mutate branches.
hurricane_strength <- mutate_branch(
  # damage vs. wind speed vs.pressure
  NDAM,
  HighestWindSpeed,
  Minpressure_Updated_2014,
  # Standardized versions
  scale(NDAM),
  scale(HighestWindSpeed),
  -scale(Minpressure_Updated_2014),
)
y <- mutate_branch(
  alldeaths, log(alldeaths + 1)
)
# Create a mverse and add the branches.
mv <- create_multiverse(hurricane) %>%
  add_mutate_branch(hurricane_strength) %>%
  add_mutate_branch(y)
# You can also add multiple branches with a single call.
mv <- create_multiverse(hurricane) %>%
  add_mutate_branch(hurricane_strength, y)

mverse documentation built on June 21, 2025, 5:09 p.m.