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.

add_mutate_branch(.mverse, ...)

# S3 method for mverse
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)