Learn R Programming

didrooRFM (version 1.0.0)

findRFM: Compute RFM for Transaction Data

Description

The function calculates the RFM value of a given customer data.The function consumes customer data in a fixed format and returns RFM values and scores for each customer. https://github.com/didroo55/didrooPackages/blob/master/didrooRFM.pdf https://youtu.be/SojqDzHpKRA

Usage

findRFM(customerdata, recencyWeight = 4, frequencyWeight = 4,
  monetoryWeight = 4)

Arguments

customerdata
- A data frame of the follwing coloumns - TransactionID, Customer ID, Date of Transaction (in date format),Amount of purchase
recencyWeight
- Weight the model should assign to the recency factor
frequencyWeight
- Weight the model should assign to the frequency factor
monetoryWeight
- Weight the model should assign to the monetory factor

Value

A data frame summarized ar customer ID level with the folloiwng data :

Individual Recency, Frequency and Monetary Scores for the data set

Weighted individual Recency, Frequency and Monetary scores for the data set

Final RFM and Weighted RFM scores for each customer

Customer class on a 5 point scale

Examples

Run this code
TransNo <- c('0','1')
CustomerID <- c('Cust1','Cust2')
DateofPurch <- as.Date(c('2010-11-1','2008-3-25'))
Amount <- c(1000,500)
customerData <- data.frame(TransNo,CustomerID,DateofPurch,Amount)
findRFM(customerData)

Run the code above in your browser using DataLab