cum_dates | R Documentation |
Calculate the total number of events by each date in a series of dates (i.e., a cumulative frequency distribution).
cum_dates(data, ...)
data |
A vector of dates. |
... |
Other arguments passed to |
The function returns a dataframe with three columns: (1) 'date', the date; (2) 'freq', the number of observations on each unique date; and (3) 'cumul', the total number of events by each date (i.e. the cumulative frequency).
Edward Lavender
#### Example (1): A simple sequence of dates cum_dates(seq.Date(as.Date("2016-01-01"), as.Date("2016-01-10"), 1)) #### Example (2): Multiple records of each date set.seed(1) dates <- seq.Date(as.Date("2016-01-01"), as.Date("2016-01-10"), 1) dates <- sort(sample(dates, size = 1000, replace = TRUE)) cum_dates(dates)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.