3/2/2021

R Markdown Presentation & Plotly

date: “3/2/2021”

Instructions

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!

R Markdown Presentation & Plotly

date: 3/2/2021

For this practice I’ll plot the histogram for the COVID cases in México City, only those cases that required hospitalization.

For this I’ll use the data from Dirección General de Epidemiología DGE.

Two graphs are included, one using only plotly andanother with ggplot.

R Markdown Presentation & Plotly

date: 3/2/2021

Preparing data

The data is already in my drive, just to make this presentation short.

I’ll get the data filtered:

dataCOVID<-read.csv2("210202COVID19MEXICO.csv",sep = ",")

dataFiltered<-filter(dataCOVID,ENTIDAD_NAC==9,TIPO_PACIENTE==2)

Slide with Plot 1

Histogram of hospitalization cases using plotly.

plot_ly(x=dataFiltered$FECHA_INGRESO, type="histogram")

Slide with Plot 2

Histogram of hospitalization cases using ggplot+plotly.

gg<-ggplot(data=dataFiltered,aes(x=FECHA_INGRESO))+stat_count()
ggplotly(gg)