R Markdown Presentation & Plotly

Coursera, Developing Data Products (Peer-graded Assignment)

Sanjaya J Shetty

Project Objective

  1. Create a web page presentation using R Markdown.
  2. Presentation should include a plot generated by plotly.
  3. The presentation should be hosted on Rpubs, GitHub, or Neocities.

r code for the Plot

library(plotly)


plot <- plot_ly(data = mtcars, x=~cyl, y=~mpg, type = "box" )%>%        
    layout(title = "Relationship between Number of Cylinder and Miles per Gallon", 
    xaxis = list(title = "Number of cylinder"), 
    yaxis = list(title = " Miles per Gallon"),
    showlegend = FALSE)

htmlwidgets::saveWidget(as_widget(plot), file = "demo.html")

The Graph

The graph represents the relationship between number of cylinder and MPG. The data for the graph is taken from mtcars.

Thank You!