Evening,
I'm teaching myself this stuff and I'm having an issue when I try to use geom_hex to make a heat chart. While I can make a chart that makes sense with 2DBin charts, the second I try to make the exact same chart with the exact same data using geom_hex it goes crazy when it tries to write the chart.
Is it a compatibility issue?
Here's my code, thanks.
library(ggplot2)
#> Warning: package 'ggplot2' was built under R version 4.2.2
library(ggplot2movies)
library(hexbin)
#> Warning: package 'hexbin' was built under R version 4.2.2
pl <- ggplot(movies, aes(x = year, y = rating))
#Now I make it a 2DBox
p2 <- pl+geom_bin2d()
print(p2 + scale_fill_gradient(high = '#0DE8EF', low = '#373C3D'))
##Output comes out fine.
#Try the same with hexbin
p2 <- pl + geom_hex()
print(p2 + scale_fill_gradient(high = 'red', low = 'blue' ))
##Output comes out looking wonky as heck with a median that is indistinguishable,
## No distinguishable heat points. I tried to do the same think with another variable.
pl <- ggplot(movies, aes(x = year, y = votes))
print(pl+geom_bin2d())
print(pl+geom_hex())
##Something isn't acting right for me.
summary(select(movies,year,votes))
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'object' in selecting a method for function 'summary': could not find function "select"
Created on 2022-11-26 with reprex v2.0.2