I want to generate an accumulating total duration based on each additional value in the new vector.
I can manually display what I'm trying to achieve but cannot complete this task with code. The aim is to create a script that will automate the 'total_duration' column based on the 'duration' column.
duration=c(1.5,8.9,3,6.2)
total_duration=c(1.5,10.4,13.4,19.6)
duration_df=data.frame(duration,total_duration)