Suppose I have the following R dataframe:
The Peril and Range columns are both factors. And I want to create a cumulative distribution column for Counts and Value