I have a sample of data that consists of time spent for some tasks in each month for several people. There is also a column "department". I need to take the value of column department and devide its value equally for each person
Date department name1 name2 name3 name4 name5 name6 name7
2022/05 117.89 85.37 30.30 108.86 14.67 23.90 77.62 23.30
2022/06 69.25 44.00 85.00 113.20 16.28 20.40 56.97 77.85
2022/07 73.55 37.36 85.00 113.20 16.28 35.68 74.86 43.34
2022/08 30.89 41.34 36.34 184.90 20.70 58.79 30.34 72.38
And I need to get
Date name1 name2 name3 etc.
2022/05. 85.37+(117.89/7) 30.30+(117.89/7) 108.86+(117.89/7)
I am trying to use function lapply but seems that i am doing smth wrong )
mydata6 <- lapply(mydata4[3:15], function(x) {x + x[1]/13} )