cumulate function

Calculates the cumulative sum, ignoring the first element if exclude.1st is TRUE