avg_closure | R Documentation |
avg_closure
returns the average length of fraternity moratoria in days.
avg_closure(data, university, start1, end1, start2, end2)
data |
an object/dataframe/tibble. |
university |
the column in the object that contains the universities. |
start1 |
the column in the object that contains the start date of the first moratorium. |
end1 |
the column in the object that contains the end date of the first moratorium. |
start2 |
the column in the object that contains the start date of the second moratorium. |
end2 |
the column in the object that contains the end date of the second moratorium. |
This function relies on dplyr, lubridate, and rlang to work. Moreover, this function does a few operations. First, it selects only the columns of interest, then, it splits a tibble into two: one for first set of closures, and one for second closures (third coming). Next, it creates columns with the length of each of these closures. Finally, it binds together the two tibbles, and takes the mean of the length.
avg_closure(data, university, start1, end1, start2, end2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.