Data for generating histograms.

rfm_hist_data(rfm_table)

Arguments

rfm_table

An object of class rfm_table.

Examples

# using transaction data analysis_date <- lubridate::as_date('2006-12-31', tz = 'UTC') rfm_order <- rfm_table_order(rfm_data_orders, customer_id, order_date, revenue, analysis_date) # histogram data rfm_hist_data(rfm_order)
#> # A tibble: 2,985 x 2 #> rfm score #> <chr> <dbl> #> 1 recency_days 205 #> 2 recency_days 140 #> 3 recency_days 194 #> 4 recency_days 132 #> 5 recency_days 90 #> 6 recency_days 84 #> 7 recency_days 281 #> 8 recency_days 246 #> 9 recency_days 349 #> 10 recency_days 619 #> # ... with 2,975 more rows
# using customer data analysis_date <- lubridate::as_date('2007-01-01', tz = 'UTC') rfm_customer <- rfm_table_customer(rfm_data_customer, customer_id, number_of_orders, recency_days, revenue, analysis_date) # histogram data rfm_hist_data(rfm_customer)
#> # A tibble: 119,997 x 2 #> rfm score #> <chr> <dbl> #> 1 recency_days 232 #> 2 recency_days 115 #> 3 recency_days 43 #> 4 recency_days 64 #> 5 recency_days 23 #> 6 recency_days 72 #> 7 recency_days 112 #> 8 recency_days 142 #> 9 recency_days 43 #> 10 recency_days 131 #> # ... with 119,987 more rows