7 February 2019

Instructions

Create a web page presentation using R Markdown that features a plot created with Plotly. Host your webpage on either GitHub Pages, RPubs or NeoCities. Your webpage must contain the date that you created the document, and it must contain a plot created with Plotly. We would love to see you show off your creativity!

Review criteria:

  1. Does the web page feature a date and is this date less than two months before the date that you're grading this assignment?

  2. Is the web page a presentation and does it feature an interactive plot that appears to have been created with Plotly?

Two plots in one

Embedding one plot in another

library(plotly)

p1 <- plot_ly(x = c(1, 1.5, 3), y = c(4, 2.5, 2), 
              name = "line 1", mode = "lines",
              line = list(color = "blue", dash = "dashed"))
p2 <- plot_ly(x = c(20, 25, 40), y = c(30, 45, 50),
              name = "line 2", mode = "lines",
              line = list(color = "red", dash = "dashed")) %>%
  layout(xaxis = list(domain = c(0.6, 0.95)),
         yaxis = list(domain = c(0.6, 0.95)))
subplot(p1, p2)

Two plots in one

A bit of anamation

Ploty possibilities for data animation

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)

A bit of anamation