cohort_count | R Documentation |
cohort_count() perform cohort analysis by counting the appearance of id_col
. id_col
will only count one time for all appearance in each time period.
This cohort analysis is suitable to measure customer retention. To summarize for example revenue of each cohort, use cohort_summarise()
cohort_count( data, .id_col, .time_col, time_unit = c("week", "month", "quarter", "year"), percent_form = TRUE, relative_time = TRUE, all_group = FALSE )
data |
Input data |
.id_col |
Variable to identify entities (maybe customer ID) |
.time_col |
Time correspond to id_col. Must be in date or date-time format |
time_unit |
Time unit to group to cohort |
percent_form |
Should return table contain percentage value or absolute value |
relative_time |
Should return column is relative time or absolute period |
all_group |
Should result include group of all entities. This argument must only set to TRUE when both percent_form and relative_time is TRUE |
a data frame with class cohort_df
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.