May 8, 2017

Slide 2

Weekly Project 3:

Create a web page presentation using R Markdown that features a plot created with Plotly.

Slide 3

The plotly package is required for plotting a graph:

require(plotly)

The data used for the graph is mtcars with the following variables

  • wt is the weight of the car
  • mpg is the miles per gallon of the car
  • cyl is the number of cylinders of the car
  • hp is the horse-power of the car.

Slide 4

plot_ly(mtcars, x = ~wt, y = ~mpg, type = "scatter",
        color = ~factor(cyl), size = ~hp)