`r params$report_title`"

```{css, echo=FALSE}

toc {

width: 20%; padding: 20px 1px 5px 1px; }

```r
## Global options
library(rfm)
library(dplyr)
library(magrittr)
library(DT)
knitr::opts_chunk$set(echo = FALSE, width = 75)

RFM Score

data <- params$data
data %>% 
  use_series(rfm) %>% 
  select(customer_id, recency_days, transaction_count, amount, rfm_score) %>% 
  datatable()

EDA

Heatmap

rfm_plot_heatmap(data, interactive = params$interactive)

Bar Chart

rfm_plot_bar_chart(data)

Order Distribution

rfm_plot_order_dist(data, interactive = params$interactive)

Recency Distribtuion

rfm_plot_histogram(data, interactive = params$interactive)

Frequency Distribtuion

rfm_plot_histogram(data, "frequency", interactive = params$interactive)

Monetary Distribtuion

rfm_plot_histogram(data, "monetary", interactive = params$interactive)

Segmentation

Segments

segments <- params$segments
segments %>% 
  select(customer_id, segment, rfm_score, transaction_count, recency_days,
         amount) %>% 
  datatable()

Segment Summary

segment_overview <- rfm_segment_summary(segments)
segment_overview %>%
  datatable()

Segment Summary Plot

rfm_plot_segment_summary(segment_overview, interactive = params$interactive)

Segmentation Plot

rfm_plot_segment(segment_overview, interactive = params$interactive)

Revenue Distribution

rfm_plot_revenue_dist(segment_overview, interactive = params$interactive)  

Median Recency

rfm_plot_median_recency(segments, interactive = params$interactive)

Median Frequency

rfm_plot_median_frequency(segments, interactive = params$interactive)

Median Monetary Value

rfm_plot_median_monetary(segments, interactive = params$interactive)

Recency vs Monetary Value

rfm_plot_segment_scatter(segments, "monetary", "recency", interactive = params$interactive)

Recency vs Frequency

rfm_plot_segment_scatter(segments, "frequency", "recency", interactive = params$interactive)

Frequency vs Monetary Value

rfm_plot_segment_scatter(segments, "monetary", "frequency", interactive = params$interactive)


Try the rfm package in your browser

Any scripts or data that you put into this service are public.

rfm documentation built on May 29, 2024, 11:50 a.m.