Data

---
title: "covid-19"
autor: "Cid Póvoas"
output: 
  flexdashboard::flex_dashboard:
    logo: "corona.png"
    favicon: "corona.ico"
    orientation: columns
    storyboard: true
    vertical_layout: fill
    theme: journal
    source_code: embed
editor_options: 
  chunk_output_type: inline
---

```{r setup, include=FALSE}
Sys.setlocale(category = "LC_ALL", locale = "English_United States.1252")

library(magrittr) 
library(lubridate)
library(tidyverse)
library(gridExtra)
library(ggforce) 
library(kableExtra) 
library(leaflet) 
library(plotly)

pkg <- c("rvest",
         "readxl",
         "dplyr",
         "knitr",
         "kableExtra",
         "stringr",
         "spData",
         "sf",
         "DT")

sapply(pkg,
       library,
       character.only = TRUE,
       logical.return = T)

# raw.data.confirmed <- read.csv('https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_confirmed_global.csv')
# raw.data.deaths <- read.csv('https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_deaths_global.csv')
# raw.data.recovered <- read.csv('https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_recovered_global.csv')
# dim(raw.data.confirmed)
# 
# n.col <- ncol(raw.data.confirmed)
# ## get dates from column names
# dates <- names(raw.data.confirmed)[5:n.col] %>% substr(2,8) %>% mdy()
# range(dates)
# min.date <- min(dates)
# max.date <- max(dates)
# min.date.txt <- min.date %>% format('%d %b %Y')
# max.date.txt <- max.date %>% format('%d %b %Y')
# 
# cleanData <- function(data) {
#   data %<>% select(-c(Province.State, Lat, Long)) %>% rename(country=Country.Region)
#   data %<>% gather(key=date, value=count, -country)
#   data %<>% mutate(date = date %>% substr(2,8) %>% mdy())
#   data %<>% group_by(country, date) %>% summarise(count=sum(count, na.rm=T)) %>% as.data.frame()
#   return(data)
# }
# 
# data.confirmed <- raw.data.confirmed %>% cleanData() %>% rename(confirmed=count)
# data.deaths <- raw.data.deaths %>% cleanData() %>% rename(deaths=count)
# data.recovered <- raw.data.recovered %>% cleanData() %>% rename(recovered=count)
# ## merge above 3 datasets into one, by country and date
# data <- data.confirmed %>% merge(data.deaths, all=T) %>% merge(data.recovered, all=T)
max.date.txt <- Sys.Date()

```

# Info {.sidebar}
=====================================

The data source used for this analysis is the 2019 Novel Coronavirus COVID-19 (2019-nCoV) Data Repository built by the Center for Systems Science and Engineering, John Hopkins University

This is an analysis report of the Novel Coronavirus (COVID-19) around the world, to demonstrate data processing and visualisation with R, tidyverse and ggplot2. This report will be updated from time to time, with new data and more analysis

Dashboard by [Cid Edson Póvoas](mailto:cidedson@gmail.com)

adapted: [Yanchang Zhao, COVID-19 Data Analysis with R – Worldwide. RDataMining.com, 2020.](http://www.rdatamining.com/docs/Coronavirus-data-analysis-world.pdf)

update: `r max.date.txt` 



Data {data-orientation=rows}
=====================================  

Row {.tabset .tabset-fade}
-------------------------------------


[NOVO ENDEREÇO](https://cid.ezsites.com.br/)