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!
install.packages('plotly')
## Installing package into 'C:/Users/Nazanin/Documents/R/win-library/4.1'
## (as 'lib' is unspecified)
## package 'plotly' successfully unpacked and MD5 sums checked
##
## The downloaded binary packages are in
## C:\Users\Nazanin\AppData\Local\Temp\RtmpgjfZL9\downloaded_packages
library(plotly)
## Loading required package: ggplot2
##
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
##
## last_plot
## The following object is masked from 'package:stats':
##
## filter
## The following object is masked from 'package:graphics':
##
## layout
library(ggplot2)
p <- plot_ly(midwest, x = ~percollege, color = ~state, type = "box")
p
f <- list(
family = "Courier New, monospace",
size = 11, color = "#6e6e6e" )
x <- list(
title = "Weight (1000 lbs)", titlefont = f )
y <- list(
title = "Mileage per gallon", titlefont = f )
plot_ly(mtcars, x = mtcars$wt, y=mtcars$mpg, mode="markers",
type="scatter",color=as.factor(mtcars$cyl), size=mtcars$hp ) %>%
layout(xaxis=x, yaxis=y)
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.