plotly.R icon indicating copy to clipboard operation
plotly.R copied to clipboard

ggplot 2.2.0 Breaks ggplotly

Open psalmody opened this issue 10 years ago • 2 comments

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 avatar Nov 04 '16 19:11 psalmody

@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")

ampu3ro avatar Nov 10 '16 20:11 ampu3ro

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.

psalmody avatar Nov 10 '16 20:11 psalmody