Displaying 6 results from an estimated 6 matches for "qdrfm".
2017 Oct 11
0
RFM analysis
Hi Hemant,
Let's take it one step at a time. Save this code as "qdrfm.R" in your
R working directory: It includes the comments I added last time and
fixes a bug in the recency scoring.
qdrfm<-function(x,rbreaks=3,fbreaks=3,mbreaks=3,
date.format="%Y-%m-%d",weights=c(1,1,1),finish=NA) {
# if no finish date is specified, use current date
if(is.na...
2017 Oct 09
1
Help RFM analysis in R (i want a code where i can define my own breaks instead of system defined breaks used in auto_RFM package)
...to the function
(rbreaks,fbreaks,mbreaks) If you want the breaks to work, make sure that
they cover the range of the input values, otherwise you get NAs.
# expects a three (or more) column data frame where
# column 1 is customer ID, column 2 is amount of purchase
# and column 3 is date of purchase
qdrfm<-function(x,rbreaks=3,fbreaks=3,mbreaks=3,date.format="%Y-%m-%d",
weights=c(1,1,1),finish=NA) {
# if no finish date is specified, use current date
if(is.na(finish)) finish<-as.Date(date(), "%a %b %d %H:%M:%S %Y")
x$rscore<-as.numeric(finish-as.Date(x[,3],date.forma...
2017 Oct 09
2
Help RFM analysis in R (i want a code where i can define my own breaks instead of system defined breaks used in auto_RFM package)
...the breaks to work, make sure that
>> they cover the range of the input values, otherwise you get NAs.
>>
>> # expects a three (or more) column data frame where
>> # column 1 is customer ID, column 2 is amount of purchase
>> # and column 3 is date of purchase
>> qdrfm<-function(x,rbreaks=3,fbreaks=3,mbreaks=3,date.format="%Y-%m-%d",
>> weights=c(1,1,1),finish=NA) {
>>
>> # if no finish date is specified, use current date
>> if(is.na(finish)) finish<-as.Date(date(), "%a %b %d %H:%M:%S %Y")
>> x$rscore<...
2017 Oct 09
0
Help RFM analysis in R (i want a code where i can define my own breaks instead of system defined breaks used in auto_RFM package)
...aks,mbreaks) If you want the breaks to work, make sure that
> they cover the range of the input values, otherwise you get NAs.
>
> # expects a three (or more) column data frame where
> # column 1 is customer ID, column 2 is amount of purchase
> # and column 3 is date of purchase
> qdrfm<-function(x,rbreaks=3,fbreaks=3,mbreaks=3,date.format="%Y-%m-%d",
> weights=c(1,1,1),finish=NA) {
>
> # if no finish date is specified, use current date
> if(is.na(finish)) finish<-as.Date(date(), "%a %b %d %H:%M:%S %Y")
> x$rscore<-as.numeric(finish-...
2017 Oct 10
0
Help RFM analysis in R (i want a code where i can define my own breaks instead of system defined breaks used in auto_RFM package)
...that
> >> they cover the range of the input values, otherwise you get NAs.
> >>
> >> # expects a three (or more) column data frame where
> >> # column 1 is customer ID, column 2 is amount of purchase
> >> # and column 3 is date of purchase
> >> qdrfm<-function(x,rbreaks=3,fbreaks=3,mbreaks=3,date.format="%Y-%m-%d",
> >> weights=c(1,1,1),finish=NA) {
> >>
> >> # if no finish date is specified, use current date
> >> if(is.na(finish)) finish<-as.Date(date(), "%a %b %d %H:%M:%S %Y")
&...
2017 Oct 06
3
Help RFM analysis in R (i want a code where i can define my own breaks instead of system defined breaks used in auto_RFM package)
I'm trying to perform an RFM analysis on the attached dataset,
I'm able to get the results using the auto_rfm function but i want to
define my own breaks for RFM.
as follow
r <-c(30,60,90)
f <-c(2,5,8)
m <-c(10,20,30)
but when i tried to define my own breaks i got the identical result for RFM
i.e 111 for every ID.
please help me with this with working R script so that i can get