I used this question and answer to get what I want (how to compute rowsums using tidyverse), but I was wondering if there was a way to do named subsetting with rowSums
. I can imagine an instance where I have a lot of variables where this would be desirable.
What I mean is something like this:
rosSums(iris, Sepal.Length, Sepal.Width)
Instead of:
rowSums(iris[1:2])
Thanks for any help in advance!