ggplotly() not rendering in Windows

Hi, I just introduced my class to ggplotly() and several students reported that ggplotly() didn't render anything, or rather, rendered an empty plot. I suggested they update R and re-install their packages, in case it was a question of versions being out of sync, but they reported no change.

Here's an example that didn't render:

library(tidyverse)
library(plotly)
library(gapminder)

p <-
gapminder %>% 
  ggplot(aes(gdpPercap, lifeExp)) +
  geom_point()

ggplotly(p)

I'd be grateful for any ideas about what might be going wrong and how to fix things!

Theres nothing inherently wrong with the code, I expect that you ran it, and succeeded to see your plot after all :slight_smile:

It would be interesting to see at what point the student is getting unexpected behaviour.
Can they head(gapminder) to prove they have some content there?
after having made p but before sending to ggplotly try submitting p to console, this should plot as a standard ggplot would.

Are the students aware to view their consoles to hunt for any warnings and errors when they get unexpected behaviour ?

If you have any doubts about the state of their installs and package versions, have them sessionInfo() and send you the results.

Sorry for not having a killer answer for you.
I've noticed your many contributions to the forum, and I doubt I've said anything you weren't aware of already, but I thought, just in case...

Thanks @nirgrahamuk, and no worries :slight_smile: : I'm afraid I'm usually completely at a loss when it comes to misbehaving machines -- my background is in mathematics, where nothing misbehaves except your own brain (which in my case happen all the time).

I was sitting next to a students while this happened, so I know that -- after just installing the latest version of R and re-installing all the relevant packages -- ggplot() behaved as expected, rendering the gapminder plot correctly. It was only when that result was passed to ggplotly() that the rendering failed, something that has never happened to me.

Your suggestion of running sessionInfo() reminded me that my own version of R is 3.6.1, rather than the students brand new 3.6.2, so maybe it's a bug that was recently introduced? I'll see if more students with different version profiles report anything...

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.