/
intro.Rmd
136 lines (98 loc) · 4.62 KB
/
intro.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
---
title: "Introduction to the covid19italy Datasets"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{intro}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```
The covid19italy R package provides a tidy format dataset of the 2019 Novel Coronavirus COVID-19 (2019-nCoV) pandemic outbreak in Italy. The package includes the following three datasets:
- `italy_total` - daily summary of the outbreak on the national level
- `italy_region` - daily summary of the outbreak on the region level
- `italy_province` - daily summary of the outbreak on the province level
The data was pull from [Italy Department of Civil Protection](http://www.protezionecivile.it/)
## Installation
You can install the released version of covid19italy from [CRAN](https://cran.r-project.org/package=covid19italy) with:
``` r
install.packages("covid19italy")
```
Or, install the most recent version from [GitHub](https://github.com/RamiKrispin/covid19italy) with:
``` r
# install.packages("devtools")
devtools::install_github("RamiKrispin/covid19Italy")
```
## Data refresh
The **covid19italy** package dev version is been updated on a daily bases. The `update_data` function enables a simple refresh of the installed package datasets with the most updated version on Github:
``` r
library(covid19italy)
update_data()
```
Note: must restart the R session to have the updates available
## Italy summary
The `italy_total` dataset provides an overall summary of the cases in Italy since the beginning of the covid19 outbreak since February 24, 2020. The dataset contains the following fields:
* `date` - timestamp, a `Date` object
* `hospitalized_with_symptoms` - daily number of patients hospitalized with symptoms
* `intensive_care` - daily number of patients on intensive care
* `total_hospitalized` - daily total number of patients hospitalized (`hospitalized_with_symptoms` + `intensive_care`)
* `home_confinement` - daily number of people under home confinement
* `cumulative_positive_cases` - a daily snapshot of the number of positive cases
* `daily_positive_cases` - daily new positive cases
* `daily_cases` - daily new positive, recovered, and death cases
* `recovered` - total number of recovered cases (cumulative)
* `death` - total number of death cases (cumulative)
* `cumulative_cases` - total number of positive cases (cumulative)
* `total_tests` - total number of tests performed (cumulative)
```{r}
library(covid19italy)
data(italy_total)
str(italy_total)
head(italy_total)
```
## Italy region level
The `italy_region` dataset provides an overall summary of the cases in Italy's regions. The dataset contains the following fields:
* `date` - timestamp, a `Date` object
* `region_code` - the region code
* `region_name` - the region name
* `lat` - region latitude coordinate
* `long` - region longitude coordinate
* `hospitalized_with_symptoms` - daily number of patients hospitalized with symptoms
* `intensive_care` - daily number of patients on intensive care
* `total_hospitalized` - daily total number of patients hospitalized (`hospitalized_with_symptoms` + `intensive_care`)
* `home_confinement` - daily number of people under home confinement
* `cumulative_positive_cases` - a daily snapshot of the number of positive cases
* `daily_positive_cases` - daily new positive cases
* `daily_cases` - daily new positive, recovered, and death cases
* `recovered` - total number of recovered cases (cumulative)
* `death` - total number of death cases (cumulative)
* `cumulative_cases` - total number of positive cases, recovered, and death (cumulative)
* `total_tests` - total number of tests performed (cumulative)
* `region_spatial` - the spatial region names as in the output of the `ne_states` function from the **rnaturalearth** package
```{r}
data(italy_region)
str(italy_region)
head(italy_region)
```
## Italy province level
The `italy_region` dataset provides an overall summary of the cases in Italy's regions. The dataset contains the following fields:
* `date` - timestamp, a `Date` object
* `region_code` - the region code
* `region_name` - the region name
* `province_code` - the province code
* `province_name` - the province name
* `province_abb` - the province abbreviation
* `lat` - province latitude coordinate
* `long` - province longitude coordinate
* `total_cases` - total number of positive cases (cumulative)
* `new_tests` - daily number of positive cases
* `province_spatial` - the spatial province names as in the output of the `ne_states` function from the **rnaturalearth** package
```{r}
data(italy_province)
str(italy_province)
head(italy_province)
```