Black Lives Matter. Please consider donating to Black Girls Code today.
Learn how to use COVID-19 data in open source Dash apps. Register for the Sept 23rd webinar with IQT!

Error: attempt to apply non-function when posting to Plotly

Hi,

Want to report a bug when posing to plotly to get embeded code.

library(plotly)
library(ggplot2)
library(reshape)

py <- plot_ly(username=“aaa”, key=“bbb”)
ggiris <- qplot(Petal.Width, Sepal.Length, data = iris, color = Species)
py$ggplotly(ggiris)

the last step throws the error:

py$ggplotly(ggiris)
Error: attempt to apply non-function

my seesionInfo:

sessionInfo()
R version 3.2.3 (2015-12-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C LC_TIME=English_United States.1252

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] plotly_2.0.16 ggplot2_2.0.0

loaded via a namespace (and not attached):
[1] Rcpp_0.12.2 magrittr_1.5 splines_3.2.3 MASS_7.3-45 munsell_0.4.2 colorspace_1.2-6
[7] lattice_0.20-33 R6_2.1.1 foreach_1.4.3 minqa_1.2.4 httr_1.0.0 stringr_1.0.0
[13] car_2.1-1 plyr_1.8.3 tools_3.2.3 nnet_7.3-11 pbkrtest_0.4-6 parallel_3.2.3
[19] caret_6.0-64 grid_3.2.3 gtable_0.1.2 nlme_3.1-122 mgcv_1.8-9 quantreg_5.19
[25] htmltools_0.3 MatrixModels_0.4-1 iterators_1.0.8 digest_0.6.9 lme4_1.1-10 Matrix_1.2-3
[31] gridExtra_2.0.0 nloptr_1.0.4 reshape2_1.4.1 viridis_0.3.2 htmlwidgets_0.5 base64enc_0.1-3
[37] codetools_0.2-14 stringi_1.0-1 scales_0.3.0 stats4_3.2.3 jsonlite_0.9.19 SparseM_1.7

Seems to me this is not a unique case, others reported the same:

http://community.plotly.com/t/errors-publishing-from-r-3-2-2-to-plot-ly/109