0

The question has confused me for about 1 months or more. When I try to get a plotly or shiny object with the package in Rstudio, nothing appeared in the Viewer window.

For the plotly, I can get the correct result in Rgui, while it it doesn't work for shiny even if I just want to get the simplest example result.

For example, when I run the following code:

library(shiny)
runExample("01_hello")

or:

library(ggplot2)
library(plotly)
data <- data.frame(x=1:10,y=1:10)
p<-ggplot(data,aes(x,y))+geom_point()
ggplotly(p)

I just got the blank window in the Viewer for Rstudio and no error message as following.

So sorry I can just put a link here

I've tried everything I could, and I've updated the Rstudio, the package but nothing helped. I remember that it worked half years ago and I really couldn't understand what happened then.

I've seen the question No plot displayed with plotly in shiny before, but it doesn't work too.

R version 3.5.1 (2018-07-02)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
Matrix products: default

locale:
[1] LC_COLLATE=Chinese (Simplified)_China.936  LC_CTYPE=Chinese 
(Simplified)_China.936   
[3] LC_MONETARY=Chinese (Simplified)_China.936 LC_NUMERIC=C                              
[5] LC_TIME=Chinese (Simplified)_China.936    

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

other attached packages:
[1] plotly_4.8.0.9000 ggplot2_3.1.0     shiny_1.2.0     

Any suggestions are very welcome, thanks!

Jiaao Yu
  • 1
  • 2
  • read the community guide lines about how to post a reproducible example – sai saran Nov 05 '18 at 07:34
  • It might not be your issue, but when displaying plots in shiny you should not forget to cover your plotting command in a `print()` function. In other words, e.g. try `plot <- ggplot(x, ...)` and then `print(plot)` instead of using the plotting command alone. As I said, this might solve your problem, but as your example isn't very reproducible it's more or less a guess. – alex_555 Nov 05 '18 at 07:46
  • I'm really sorry for the mistake before and I've copied my code there and I hope anyone can help me. – Jiaao Yu Nov 06 '18 at 01:14

0 Answers0