You are on page 1of 1

myfile <- read.csv(file="C:/Users/ishagoyal/Desktop/rfm.

csv",header=TRUE,sep=",");
myfile <- within(myfile, quartile <- as.integer(cut(m, quantile(m, probs=0:4/4),
include.lowest=TRUE)))
myfile <- within(myfile, quartiledate <- as.integer(cut(r, quantile(r,
probs=0:4/4), include.lowest=TRUE)))
myfile <- within(myfile, quartilefreq <- as.integer(.bincode(f, quantile(f,
probs=0:4/4), include.lowest=TRUE)))
write.csv(myfile,file="myfile.csv")

You might also like