Skip to contents

[Experimental]

Usage

labs_restore(data, cols = NULL)

Arguments

data

A data frame.

cols

A tidyselect column selection.

Value

A data frame.

Details

You can store labels before mutate operations by calling labs_store.

Examples

library(dplyr)
#> 
#> Attaching package: ‘dplyr’
#> The following objects are masked from ‘package:stats’:
#> 
#>     filter, lag
#> The following objects are masked from ‘package:base’:
#> 
#>     intersect, setdiff, setequal, union
library(volker)

volker::chatgpt |>
  labs_store() |>
  mutate(sd_age = 2024 - sd_age) |>
  labs_restore() |>
  tab_metrics(sd_age)
#> 
#> 
#> |Age    |  value|
#> |:------|------:|
#> |min    |   1956|
#> |q1     |   1972|
#> |median |   1986|
#> |q3     |   1997|
#> |max    |   2006|
#> |mean   | 1984.3|
#> |sd     |   13.8|
#> |n      |    101|