For my university internship I have lots of datasets that I should do the same functions, in Excel, over and over for each one. I decided to do an R script and I'm almost finishing, I just need help in this last step.
I have some countys productions by year, and I want to multiply all year columns in this list by a specific column, the latitude column, and the result should come in the form of new columns named xlat+year.
I tried lots of for loops but I can't get it right.
This is an example in Excel of what I want to do in R. I multiplied the F2 column (production) by the D2 column (latitude).