Skip to contents

Mutation method for xpose_set

Usage

# S3 method for class 'xpose_set'
mutate(.data, ..., .force = FALSE, .retest = !.force, .rowwise = FALSE)

Arguments

.data

<xpose_set> An xpose_set object

...

<dynamic-dots> Mutations to apply to the xpose_set (passed through to <dplyr::mutate>)

.force

<logical> Should top-level elements be allowed to be manipulated? (default: FALSE)

.retest

<logical> Should the xpose_set be retested after mutation? (default: !force)

.rowwise

<logical> Should the mutation be applied rowwise? (default: FALSE)

Value

A set with updated top-level data (unless focused)

Examples

xpdb_set %>%
  # Adds foo = bar for all objects in the set
  mutate(foo = "bar") %>%
  # Reshape to visualize
  reshape_set()
#> # A tibble: 4 × 6
#>   xpdb         label parent       base  focus foo  
#>   <named list> <chr> <named list> <lgl> <lgl> <chr>
#> 1 <xp_xtras>   mod1  <chr [1]>    FALSE FALSE bar  
#> 2 <xp_xtras>   mod2  <chr [1]>    FALSE FALSE bar  
#> 3 <xp_xtras>   fix1  <chr [1]>    FALSE FALSE bar  
#> 4 <xp_xtras>   fix2  <chr [1]>    FALSE FALSE bar