# using transaction data
analysis_date <- as.Date('2006-12-31')
rfm_order <- rfm_table_order(rfm_data_orders, customer_id, order_date,
revenue, analysis_date)
# histogram
# ggplot2
rfm_plot_histogram(rfm_order, metric = "frequency")
# plotly
rfm_plot_histogram(rfm_order, metric = "frequency", interactive = TRUE)
# using customer data
analysis_date <- as.Date('2007-01-01')
rfm_customer <- rfm_table_customer(rfm_data_customer, customer_id,
number_of_orders, recency_days, revenue, analysis_date)
# histogram
rfm_plot_histogram(rfm_customer)
Run the code above in your browser using DataLab