I have never used the plotly package or any of its functions. Here are alternative solutions, including the one that works best for me (from the package lattice).
Raw data (by the way, it would be very useful if you provided test data like this, and not just a printout, as you have above).
d1 <- data.frame(UserID = factor(rep(paste("id", 1:10), 50, sep = "")),
RR = factor(rep(1:5, 100)),
FF = factor(rep(1:5, each = 100)),
MM = round(1000*rnorm(500), 2))
table(d1$R, d1$F)
d.l <- aggregate(x = d1$M,
by = list(RR = d1$RR,
FF = d1$FF),
FUN = mean)
d.w <- reshape(data = d.l,
idvar = "RR",
timevar = "FF",
direction = "wide")
mm <- as.matrix(d.w[, -1])
colnames(mm) <- 1:5
1:
heatmap(mm,
Rowv = NA,
Colv = NA,
xlab = "FF",
ylab = "RR",
main = "XXX")

, , .
2 ( ):
require(lattice)
levelplot(mm,
xlab = "FF",
ylab = "RR",
main = "XXX",
col.regions = heat.colors)

3: gplots
require(gplots)
heatmap.2(mm,
Rowv = F,
Colv = F,
density.info = "none",
trace = "none",
xlab = "FF",
ylab = "RR",
main = "XXX")

4: ggplots
, .