Por que o parâmetro bins é desconhecido para a função stat_density2d? (ggmap)
Estou preso a isso há horas. Quando eu executo isso:
library(ggmap)
set.seed(1)
n=100
df <- data.frame(x=rnorm(n, 0, 1), y=rnorm(n, 0, 1))
TestData <- ggplot (data = df) +
stat_density2d(aes(x = x, y = y,fill = as.factor(..level..)),bins=4, geom = "polygon",) +
geom_point(aes(x = x, y = y)) +
scale_fill_manual(values = c("yellow","red","green","royalblue", "black"))
Recebo esta mensagem de erro:
Error: Unknown parameters: bins
Alguem sabe por quê?