尝试使用RFM细分客户时遇到错误:
Error in .f(.x[[i]], ...) : object 'date_most_recent' not found
我多次运行了代码。我有所有需要的论点,但我仍然不明白为什么会出错。我已经有了结果表。
rfm_result <- rfm_table_customer(mydata,cid, count, recency_days, sum)
segment_names <- c("Champions", "Loyal Customers", "Potential Loyalist",
"New Customers", "Promising", "Need Attention", "About To Sleep","At Risk", "Can't Lose Them", "Lost")
recency_lower <- c(4, 2, 3, 4, 3, 2, 2, 1, 1, 1)
recency_upper <- c(5, 5, 5, 5, 4, 3, 3, 2, 1, 2)
frequency_lower <- c(4, 3, 1, 1, 1, 2, 1, 2, 4, 1)
frequency_upper <- c(5, 5, 3, 1, 1, 3, 2, 5, 5, 2)
monetary_lower <- c(4, 3, 1, 1, 1, 2, 1, 2, 4, 1)
monetary_upper <- c(5, 5, 3, 1, 1, 3, 2, 5, 5, 2)
rfm_segments<- rfm_segment(rfm_result, segment_names, recency_lower, recency_upper,frequency_lower, frequency_upper, monetary_lower, monetary_upper)
.f(.x [[i]],...)中的错误:找不到对象'date_most_recent'
使用我的最后一行代码,我应该能够创建我的细分。我需要帮助!