项目作者: Kushtrimvisoka

项目描述 :
R Package with Covid19 data
高级语言: R
项目地址: git://github.com/Kushtrimvisoka/covid19kosovo.git
创建时间: 2020-12-08T12:49:44Z
项目社区:https://github.com/Kushtrimvisoka/covid19kosovo

开源协议:Other

下载


" class="reference-link">covid19kosovo

The “covid19kosovo” R package offers data on the Covid-19 situation in
Kosovo, including daily totals of confirmed cases, recovered patients,
and deaths at the national level, as well as by municipality and
cadastral zone. However, please note that this package is no longer
being updated and the data provided is only from March 13th, 2020 to
February 6th, 2022. Additionally, the information is sourced from the
IKSHPK Facebook page page and its
accuracy cannot be guaranteed.

Datasets:

  • Daily summaries of confirmed, healed, and death cases on the national
    level.

  • Daily summaries of confirmed cases by municipality.

  • Daily summaries of confirmed cases by cadastral zone (village).

Installation

To install the R package ‘covid19kosovo’ from Github, you will need to
have the devtools package installed. If you do not have devtools
installed, you can install it by running the following command:

  1. install.packages("devtools")

Once ‘devtools’ is installed, you can use the ‘install_github()’
function to install the ‘covid19kosovo’ package. The basic syntax for
installing a package from Github using ‘install_github()’ is:

  1. devtools::install_github("Kushtrimvisoka/covid19kosovo")

Example

  1. library(covid19kosovo)

Daily summaries of confirmed, healed, and death cases on the national
level.

  1. data <- covid19kosovo(level = "total")
  2. #> Downloading data from
  3. #> https://raw.githubusercontent.com/Kushtrimvisoka/datasets/main/covid19kosovo_timeseries.csv...
  4. head(data)
  5. #> date confirmed healed dead confirmed_cumulative healed_cumulative
  6. #> 1 2020-03-13 2 0 0 2 0
  7. #> 2 2020-03-14 3 0 0 5 0
  8. #> 3 2020-03-15 3 0 0 8 0
  9. #> 4 2020-03-16 7 0 0 15 0
  10. #> 5 2020-03-17 4 0 0 19 0
  11. #> 6 2020-03-18 1 0 0 20 0
  12. #> dead_cumulative active
  13. #> 1 0 2
  14. #> 2 0 5
  15. #> 3 0 8
  16. #> 4 0 15
  17. #> 5 0 19
  18. #> 6 0 20

Daily summaries of confirmed cases by municipality.

  1. data <- covid19kosovo(level = "municipality")
  2. #> Downloading data from
  3. #> https://raw.githubusercontent.com/Kushtrimvisoka/datasets/main/covid19kosovo_timeseries_municipality.csv...
  4. head(data)
  5. #> date id municipality confirmed
  6. #> 1 2020-03-13 8 Klinë 1
  7. #> 2 2020-03-13 26 Viti 1
  8. #> 3 2020-03-14 30 Malishevë 1
  9. #> 4 2020-03-14 26 Viti 2
  10. #> 5 2020-03-15 30 Malishevë 3
  11. #> 6 2020-03-16 15 Obiliq 1

Daily summaries of confirmed cases by cadastral zone (village).

  1. data <- covid19kosovo(level = "village")
  2. #> Downloading data from
  3. #> https://raw.githubusercontent.com/Kushtrimvisoka/datasets/main/covid19kosovo_timeseries_cz.csv...
  4. head(data)
  5. #> date id municipality cadastral_zone confirmed
  6. #> 1 2020-03-13 8 Klinë Dranashiq 1
  7. #> 2 2020-03-13 26 Viti Stubëll e Poshtme 1
  8. #> 3 2020-03-14 30 Malishevë Bubavec 1
  9. #> 4 2020-03-14 26 Viti Stubëll e Poshtme 2
  10. #> 5 2020-03-15 30 Malishevë Bubavec 1
  11. #> 6 2020-03-15 30 Malishevë Llashkadrenoc 1

Daily vaccination process

  1. data <- vaccination()
  2. #> Downloading data from
  3. #> https://raw.githubusercontent.com/Kushtrimvisoka/datasets/main/kosovo_dailyvaccinations.csv...
  4. head(data)
  5. #> date daily_vaccinated one_dose two_doses three_doses total_doses
  6. #> 1 2021-05-30 1120 NA 0 NA 64776
  7. #> 2 2021-05-31 2318 NA 0 NA 67094
  8. #> 3 2021-06-01 2595 NA 0 NA 69686
  9. #> 4 2021-06-02 2955 NA 0 NA 72637
  10. #> 5 2021-06-03 2915 NA 0 NA 75553
  11. #> 6 2021-06-04 2922 NA 0 NA 78477

Map - Confirmed cases by municipality

  1. library(tidyverse)
  2. #> ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.2 ──
  3. #> ✔ ggplot2 3.4.0 ✔ purrr 1.0.0
  4. #> ✔ tibble 3.1.8 ✔ dplyr 1.0.10
  5. #> ✔ tidyr 1.2.1 ✔ stringr 1.5.0
  6. #> ✔ readr 2.1.3 ✔ forcats 0.5.2
  7. #> ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
  8. #> ✖ dplyr::filter() masks stats::filter()
  9. #> ✖ dplyr::lag() masks stats::lag()
  10. library(sf)
  11. #> Linking to GEOS 3.10.2, GDAL 3.4.2, PROJ 8.2.1; sf_use_s2() is TRUE
  12. # devtools::install_github("Kushtrimvisoka/kosovomaps")
  13. library(kosovomaps)
  14. library(covid19kosovo)
  15. rksmap <- mapof("municip")
  16. data <- covid19kosovo(level = "municipality") %>%
  17. group_by(id, municipality) %>%
  18. summarise(confirmed = sum(confirmed))
  19. #> Downloading data from https://raw.githubusercontent.com/Kushtrimvisoka/datasets/main/covid19kosovo_timeseries_municipality.csv...
  20. #> `summarise()` has grouped output by 'id'. You can override using the `.groups` argument.
  21. rksmap <- merge(rksmap, data)
  22. p <- ggplot()+
  23. geom_sf(data = rksmap, aes(fill = confirmed)) +
  24. scale_fill_viridis_c("Confirmed", direction = -1) +
  25. theme_void()
  26. p