这是我的rfm_table数据框:
我想使用R语言中的Recency(最近)、Frequency(频率)和Monetary(货币)三列数据创建热力图,就像下面这张图片一样: 我使用了"plotly"包,并编写以下代码,但出现了以下错误:
UserID R F M Rsegment Fsegment Msegment Total_Score
1 10609 984 3 318.78 2 4 4 244
2 10922 648 1 184.26 5 2 3 523
3 11300 1022 1 91.02 2 2 2 222
4 11400 864 5 851.73 3 5 5 355
5 11487 797 1 147.22 3 2 3 323
6 11762 1042 1 32.31 1 2 1 121
我想使用R语言中的Recency(最近)、Frequency(频率)和Monetary(货币)三列数据创建热力图,就像下面这张图片一样: 我使用了"plotly"包,并编写以下代码,但出现了以下错误:
# minimal value for n is 3, returning requested palette with 3 different levels
plot_ly(z = rfm_table[,c(5,6,4)]
x = c("1","2","3","4","5"), y =c("1","2","3","4","5"),
type = "heatmap")
有人能解释一下我该做什么吗?