resetting cumsum if value goes to negative in r

Leave a Comment