I am trying to calculate rowwise averages for a number of columns. Could somebody please explain why the code below only calculates the mean for the two variables in the code (var_1 and var_13), rather than the mean for all 13 columns?
df %>%
rowwise() %>%
mutate(varmean = mean(var_1:var_13)) -> df