plotly.R
plotly.R copied to clipboard
ggplot 2.2.0 Breaks ggplotly
When using ggplot 2.2.0, gg2list in ggplotly throws an error:
Error in gg2list(p, width = width, height = height, tooltip = tooltip, :
attempt to apply non-function
Code to reproduce:
df <- read.table(header = TRUE, text='
Standing Students
FF 71
FR 118
SO 102
JR 37
SR 12')
install.packages("devtools")
devtools::install_github("hadley/ggplot2")
install.packages('plotly')
require(ggplot2)
require(plotly)
p <- ggplot(df, aes(x=Standing, y=Students)) +
geom_bar(stat='identity')
ggplotly(p)
@psalmody I think it's just a compatibilty issue. I ran into the same problem but plotly 4.5.5.9000 seems to play nice with ggplot2 2.2.0. Try devtools::install_github("ropensci/plotly")
You are correct. I was using the CRAN package for plotly and the hadley/ggplot2 github repo for ggplot2. No issue with github master repo for plotly.