Developing Data Product (John HOPKINS UNIVERSITY COURSERA) - Assigment Week 3

Mohamed Lemine Beydia

12/12/2021

Dataset information

During the assignement for this week,we were asked to Create a web page presentation using R Markdown that features a plot created with Plotly and to host our webpage on either GitHub Pages, RPubs, or NeoCities The dataset used in this presentation is from the Motor Trend Car Road Tests dataset in R and it is called mtcars. The data was extracted from the 1974 Motor Trend US magazine, and comprises fuel consumption and 10 aspects of automobile design and performance for 32 automobiles (1973–74 models).

2D Scatterplot : Slide with R Code

library(plotly)
data(mtcars)
cars <- mtcars
p <- plot_ly(cars, x=cars$wt, y=cars$mpg,
mode="markers", color=cars$hp, size=cars$qsec) %>%
layout(xaxis = list(title = "Weight (1000 lbs)"),
yaxis = list(title = "miles per gallon") )

2D Scatterplot : Slide with Plot

3D Scatterplot : Slide with R Code

library(plotly)
data(mtcars)
cars <- mtcars
library(plotly)
p <- plot_ly(cars, x=cars$wt, y=cars$mpg, z=cars$hp,
type="scatter3d", mode="markers",
color=cars$drat, size=cars$qsec) %>%
layout(scene=list(
xaxis = list(title = "Weight (1000 lbs)"),
yaxis = list(title = "miles per gallon"),
zaxis = list(title = "Gross horsepower)"))
)

3D Scatterplot : Slide with Plot