imperialCHEPI / healthgpsrvis

A set of scripts for plotting and visualising data related to Health-GPS
https://imperialchepi.github.io/healthgpsrvis/
Other
0 stars 0 forks source link

clean using `dplyr::mutate` and pipe operator #31

Closed jzhu20 closed 2 months ago

jzhu20 commented 3 months ago

Rewrite lines 151-154 in R/data-process.R as follows:

data_mean_weighted_rf_wide <- data_mean_weighted_rf_wide |>
    mutate(data_mean_weighted_rf_wide$diff_sodium = data_mean_weighted_rf_wide$weighted_sodium_intervention - data_mean_weighted_rf_wide$weighted_sodium_baseline,
      data_mean_weighted_rf_wide$diff_ei = data_mean_weighted_rf_wide$weighted_energyintake_intervention - data_mean_weighted_rf_wide$weighted_energyintake_baseline,
      data_mean_weighted_rf_wide$diff_bmi = data_mean_weighted_rf_wide$weighted_bmi_intervention - data_mean_weighted_rf_wide$weighted_bmi_baseline,
      data_mean_weighted_rf_wide$diff_obesity = data_mean_weighted_rf_wide$weighted_obesity_intervention - data_mean_weighted_rf_wide$weighted_obesity_baseline)