(I am a SAS programmer trying to learn R).
I have multiple numeric columns. Using dplyr
, I want to get a mean of those multiple values per each row. In SAS, this would be:
newvariable = mean(of x1, x2, x3, x4, x5);
I imagined it would look like this in R, but it just generates an error message.
Code:
time1data %>%
mutate(newvariable = mean(of x1, x2, x3, x4, x5)) %>%
head