cohort_count: Create cohort data

View source: R/cohort.R

cohort_countR Documentation

Create cohort data

Description

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()

Usage

cohort_count(
  data,
  .id_col,
  .time_col,
  time_unit = c("week", "month", "quarter", "year"),
  percent_form = TRUE,
  relative_time = TRUE,
  all_group = FALSE
)

Arguments

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

Value

a data frame with class cohort_df


vohai611/rcohort documentation built on April 13, 2022, 6:40 a.m.