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 like so:
How would I do this? I am using dplyr if that helps.
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 like so:
How would I do this? I am using dplyr if that helps.
Copyright © 2021 Jogjafile Inc.
Assuming you have the data stored in
df
this should work:However your first and second table seem to have different counts and values for the 'Other' Peril.