hi I think this will work
df <- data.frame(replicate, start, Volume_loss) df %>% mutate( Cum_vol_loss= cumsum(Volume_loss), Final_Volume=(start-Cum_vol_loss) )