I'm trying to apply a simple operation to multiple columns in a dataset.
I tried using a function like the one explained in Applying function on multiple columns to create multiple new columns, but I haven't been able to get it.
here is the equations, where wt is the set of column named wt_jan, wt_feb ... wt_dec
ne_maintain = 0.386*wt^0.75
I tried using mutate() but have not been able to figure out how to repeat my calulation multiple times.
here is what the dataset looks like:
lactation wt_jan wt_feb wt_mar wt_apr wt_may wt_jun wt_jul wt_aug wt_sep wt_oct wt_nov wt_dec
1 1 600.0 612.5 625.0 637.5 643.8 650.0 656.3 662.5 668.8 675.0 681.3 687.5
2 2 693.8 700.0 706.3 712.5 715.6 718.8 721.9 725.0 728.1 731.3 734.4 737.5
3 3 740.6 743.8 746.9 750.0 750.0 750.0 750.0 750.0 750.0 750.0 750.0 750.0
4 4 750.0 750.0 750.0 750.0 750.0 750.0 750.0 750.0 750.0 750.0 750.0 750.0
5 5 750.0 750.0 750.0 750.0 750.0 750.0 750.0 750.0 750.0 750.0 750.0 750.0
6 6 750.0 750.0 750.0 750.0 750.0 750.0 750.0 750.0 750.0 750.0 750.0 750.0
and what I would like in the end is a new set of columns named ne_maintenance_jan ... all the way to December. I have about 10 calculation i need to do in total so hoping that this post solves it!