What is the way to perform row-wise multiplication of all columns selected from a daraframe. Below Mult columns is created explicitly by saying what variables to multiply.
What if I selected different columns? What code needs to be in mutate so it will multiply all columns selected before? NOTE: number of selected columns will not always be three.
example:
library(tidyverse)
mtcars %>%
select(hp, qsec, disp) %>%
mutate(mult = hp * qsec * disp)