R Markdown

install.packages("plotly")
## Installing package into '/usr/local/lib/R/site-library'
## (as 'lib' is unspecified)
## Warning in download.file(url, destfile, method, mode =
## "wb", ...): URL 'https://rspm-sync.rstudio.com/bin/4.0-focal/
## 69563730dd70bf57fcd6fd5d137fe7ba01a83b401c5204838f912b6eb819791c.tar.gz': status
## was 'SSL connect error'
## Error in download.file(url, destfile, method, mode = "wb", ...) : 
##   cannot open URL 'https://packagemanager.rstudio.com/all/__linux__/focal/291/src/contrib/plotly_4.9.2.1.tar.gz'
## Warning in download.packages(pkgs, destdir = tmpd, available = available, :
## download of package 'plotly' failed
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
install.packages("ggplot2")
## Installing package into '/usr/local/lib/R/site-library'
## (as 'lib' is unspecified)
## Warning in download.file(url, destfile, method, mode =
## "wb", ...): URL 'https://rspm-sync.rstudio.com/bin/4.0-focal/
## f6fadf2cd5e4423ae507480b327aea392745729890a7b37e33a2d4e506d99be8.tar.gz': status
## was 'SSL connect error'
## Error in download.file(url, destfile, method, mode = "wb", ...) : 
##   cannot open URL 'https://packagemanager.rstudio.com/all/__linux__/focal/291/src/contrib/ggplot2_3.3.1.tar.gz'
## Warning in download.packages(pkgs, destdir = tmpd, available = available, :
## download of package 'ggplot2' failed
library(ggplot2)

Including Plots

You can also embed plots, for example:

## No scatter mode specifed:
##   Setting the mode to markers
##   Read more about this attribute -> https://plotly.com/r/reference/#scatter-mode
## No scatter mode specifed:
##   Setting the mode to markers
##   Read more about this attribute -> https://plotly.com/r/reference/#scatter-mode
## 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.

Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.