Calculate how much of one good habit compensates for a bad habit.
Arguments
- bad_habit
Factor name of the bad habit (from
chronic_risks())- good_habit
Factor name of the compensating behavior (from
chronic_risks())
Examples
# How much exercise offsets 2 cigarettes?
lifestyle_tradeoff("Smoking 2 cigarettes", "20 min moderate exercise")
#> # A tibble: 1 × 6
#> bad_habit bad_ml_per_day good_habit good_ml_per_day units_needed
#> <chr> <dbl> <chr> <dbl> <dbl>
#> 1 Smoking 2 cigarettes -1 20 min moder… 2 0.5
#> # ℹ 1 more variable: interpretation <chr>
