Data for generating bar charts.

rfm_barchart_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) # bar chart data rfm_barchart_data(rfm_order)
#> # A tibble: 995 x 9 #> customer_id date_most_recent recency_days transaction_count amount #> <chr> <date> <dbl> <dbl> <dbl> #> 1 Abbey O'Reilly DVM 2006-06-09 205 6 472 #> 2 Add Senger 2006-08-13 140 3 340 #> 3 Aden Lesch Sr. 2006-06-20 194 4 405 #> 4 Admiral Senger 2006-08-21 132 5 448 #> 5 Agness O'Keefe 2006-10-02 90 9 843 #> 6 Aileen Barton 2006-10-08 84 9 763 #> 7 Ailene Hermann 2006-03-25 281 8 699 #> 8 Aiyanna Bruen PhD 2006-04-29 246 4 157 #> 9 Ala Schmidt DDS 2006-01-16 349 3 363 #> 10 Alannah Borer 2005-04-21 619 4 196 #> # ... with 985 more rows, and 4 more variables: recency_score <fct>, #> # frequency_score <int>, monetary_score <int>, rfm_score <dbl>
# 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) # bar chart data rfm_barchart_data(rfm_customer)
#> # A tibble: 39,999 x 8 #> customer_id recency_days transaction_count amount recency_score #> <dbl> <dbl> <dbl> <dbl> <fct> #> 1 22086 232 9 777 2 #> 2 2290 115 16 1555 4 #> 3 26377 43 5 336 5 #> 4 24650 64 12 1189 5 #> 5 12883 23 12 1229 5 #> 6 2119 72 11 929 5 #> 7 31283 112 17 1569 4 #> 8 33815 142 11 778 3 #> 9 15972 43 9 641 5 #> 10 27650 131 10 970 3 #> # ... with 39,989 more rows, and 3 more variables: frequency_score <int>, #> # monetary_score <int>, rfm_score <dbl>