Last active
February 9, 2016 07:18
-
-
Save havlikp/091cf9be8f772f636b56 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## R setup (https://github.com/hoxo-m/easyRFM) | |
install.packages("devtools") # if you have not installed "devtools" package | |
devtools::install_github("hoxo-m/easyRFM") | |
library(easyRFM) | |
## setwd("~/Desktop") | |
## Load / View Data | |
data <- rfm_generate_data(30000, begin="2014-01-01", end="2015-12-31", seed=123) | |
summary(data$payment) | |
## Calculate RFM | |
RFM <- rfm_auto(data, breaks=list(r=7, f=7, m=7)) | |
## Review Results | |
RFM$breaks | |
RFM$classes | |
RFM$get_table("RF") | |
## Export Result | |
write.csv(RFM$rfm, file = "rfm.csv", row.names = FALSE) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment