I'm new to using the plotly package in R and want to animate a line graph. An example would be if I were plotting the GDPpercapita(x-axis) and Life Expectancy (y-axis) of one country. plotly book for R
data(gapminder, package = "gapminder")
gg <- ggplot(gapminder, aes(gdpPercap, lifeExp, color = continent)) +
geom_point(aes(size = pop, frame = year, ids = country)) +
scale_x_log10()
ggplotly(gg)
I tried creating an ordinary line graph with plotly and adding the frame argument (frame=~year) but the graph is blank.
How can I use Plotly's animation capability to animate a line graph?
Also gganimate is not an option for me as there seems to be a problem with running ImageMagick on Windows.
