Data for generating heatmap.

rfm_heatmap_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) # heat map data rfm_heatmap_data(rfm_order)
#> # A tibble: 25 x 3 #> # Groups: frequency_score [?] #> frequency_score recency_score monetary #> <int> <int> <dbl> #> 1 1 1 208. #> 2 1 2 247. #> 3 1 3 246. #> 4 1 4 213. #> 5 1 5 262. #> 6 2 1 380. #> 7 2 2 408. #> 8 2 3 355. #> 9 2 4 375. #> 10 2 5 370. #> # ... with 15 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) # heat map data rfm_heatmap_data(rfm_customer)
#> # A tibble: 25 x 3 #> # Groups: frequency_score [?] #> frequency_score recency_score monetary #> <int> <int> <dbl> #> 1 1 1 537. #> 2 1 2 571. #> 3 1 3 580. #> 4 1 4 584. #> 5 1 5 593. #> 6 2 1 812. #> 7 2 2 814. #> 8 2 3 811. #> 9 2 4 822. #> 10 2 5 813. #> # ... with 15 more rows