0

I am running the example code for the Slider function (example 2) in R:https://plot.ly/r/animations/

I want to simply reproduce the given example.

However, the graph doesn't show up in my viewer.

This is the codeI run in R:

 library(plotly)
library(gapminder)

p <- gapminder %>%
  plot_ly(
    x = ~gdpPercap, 
    y = ~lifeExp, 
    size = ~pop, 
    color = ~continent, 
    frame = ~year, 
    text = ~country, 
    hoverinfo = "text",
    type = 'scatter',
    mode = 'markers'
  ) %>%
  layout(
    xaxis = list(
      type = "log"
    )
  )

I didn't change it from the way it is described here.

Can one help me and tell me why the graph doesn't show up?

1 Answers1

1

I tried to run the code at start without success as well. Basically the issue was :

Evaluation error: `as_dictionary()` is defunct as of rlang 0.3.0 Please use `as_data_pronoun()` instead.

I think you just need to update your dplyr to the latest version 0.7.7.

install.packages("dplyr") #or update current version

Also check that :

  • Any package larger than a few Kb gives the message:
  Warning in install.packages :

unable to move temporary installation ‘C:\Users[myname]\R\win-library\3.4\file2b884fc37c13\packagename’ to ‘C:\Users[myname]\R\win-library\3.4\packagename’

  • If so,Type in : trace(utils:::unpackPkgZip,edit = T)
    and edited Line 140 Sys.sleep(0.5) to Sys.sleep(2).

Then you can Run your code and print p
Check out the plot

btw a real cool one !

Galileo
  • 81
  • 1
  • 4