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!
The rubric contains the following two questions:
library(plotly)
data <- diamonds[sample(nrow(diamonds), 2500),
c("carat", "price", "clarity", "depth")]
summary(data)
carat price clarity depth
Min. :0.2000 Min. : 360 SI1 :630 Min. :55.00
1st Qu.:0.4000 1st Qu.: 942 VS2 :535 1st Qu.:61.10
Median :0.7100 Median : 2415 SI2 :435 Median :61.90
Mean :0.7925 Mean : 3843 VS1 :379 Mean :61.82
3rd Qu.:1.0400 3rd Qu.: 5303 VVS2 :220 3rd Qu.:62.50
Max. :3.0100 Max. :18757 VVS1 :180 Max. :69.20
(Other):121
p1 <- plot_ly(data, x = ~carat, y = ~price, color = ~carat,
size = ~carat, text = ~paste("Clarity: ", clarity))
p2 <- plot_ly(data, x = ~carat, y = ~price, z = ~depth,
color = ~carat, size = ~carat,
text = ~paste("Clarity: ", clarity))