[Solved] how to avoid repeated codes in R

[ad_1]

I think you may want either of these two

new_table %>%
  group_by(sex, category, flag, day) %>%
  mutate(mean = mean(value),
         standardDeviation = sd(value))

or

new_table %>%
  group_by(sex, category, flag, day) %>%
  summarise(mean = mean(value),
         standardDeviation = sd(value))

1

[ad_2]

solved how to avoid repeated codes in R