Imports

options(repos="https://cran.rstudio.com" )
install.packages("readr")
install.packages("dplyr")
library(readr)
library (dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union

COVID-19 Cases Evolution in Bogota

bd <- read_csv2("covid28092020.csv")
## Using ',' as decimal and '.' as grouping mark. Use read_delim() for more control.
## Parsed with column specification:
## cols(
##   FechaInicioSx = col_character(),
##   FechaDx = col_character(),
##   Ciudad = col_character(),
##   Residencia = col_character(),
##   Edad = col_double(),
##   Sexo = col_character(),
##   TipoCaso = col_character(),
##   Ubicacion = col_character(),
##   Estado = col_character()
## )
casos<- as.data.frame(table(bd$FechaDx))
casos$Var1<- as.Date(casos$Var1, "%d/%m/%y")
arrange(casos, Var1)

install.packages("plotly")
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

Figure 1

plot_ly(casos, x= ~Var1, y= ~Freq, size = ~Freq)
## No trace type specified:
##   Based on info supplied, a 'scatter' trace seems appropriate.
##   Read more about this trace type -> https://plot.ly/r/reference/#scatter
## No scatter mode specifed:
##   Setting the mode to markers
##   Read more about this attribute -> https://plot.ly/r/reference/#scatter-mode
## Warning: `arrange_()` is deprecated as of dplyr 0.7.0.
## Please use `arrange()` instead.
## See vignette('programming') for more help
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_warnings()` to see where this warning was generated.
## Warning: `line.width` does not currently support multiple values.

COVID-19 Deaths Cases Evolution in Bogota

c<- filter(bd, Estado=="Fallecido")
muertes <- as.data.frame(table(c$FechaDx))
muertes$Var1<- as.Date(muertes$Var1, "%d/%m/%y")
arrange(muertes, Var1)

Figure 2

## No trace type specified:
##   Based on info supplied, a 'scatter' trace seems appropriate.
##   Read more about this trace type -> https://plot.ly/r/reference/#scatter
## No scatter mode specifed:
##   Setting the mode to markers
##   Read more about this attribute -> https://plot.ly/r/reference/#scatter-mode
## Warning: `line.width` does not currently support multiple values.