I would like to transform the sales column in each row, using the parameters in “addition” and “division” and then automatically create a named column that contains this transformation for that row value
Here is the sample data
set.seed(1)
time=seq(1:4)
sales=rpois(4,7)
addition_vec=c(0,5,10)
division_vec=c(1,2,3)
starter_df=data.frame(time,sales)
and here is what I would like to come out of it, but with the NA values populated with the relevant calculations for the named column. Calculations should be to add to sales by with the value in “addition_vec”, and then divide the sum by the value in “division_vec”