{"id":18285372,"url":"https://github.com/seandavi/sars2pack","last_synced_at":"2026-02-25T15:08:43.064Z","repository":{"id":54196547,"uuid":"249267381","full_name":"seandavi/sars2pack","owner":"seandavi","description":"An R package with over 50 highly cited, read-to-use, up-to-date COVID-19 pandemic data resources","archived":false,"fork":false,"pushed_at":"2022-05-09T22:35:28.000Z","size":1041245,"stargazers_count":59,"open_issues_count":18,"forks_count":14,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-05-23T11:30:19.441Z","etag":null,"topics":["biomedical-data","coronavirus","coronavirus-tracking","covid-19","data-science","data-visualization","datascience","datasets","epidemics","epidemiology","geospatial","public-health","rstats","rstats-package"],"latest_commit_sha":null,"homepage":"https://seandavi.github.io/sars2pack/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/seandavi.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-22T20:32:46.000Z","updated_at":"2024-03-12T12:45:56.000Z","dependencies_parsed_at":"2022-08-13T09:00:23.413Z","dependency_job_id":null,"html_url":"https://github.com/seandavi/sars2pack","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/seandavi/sars2pack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seandavi%2Fsars2pack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seandavi%2Fsars2pack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seandavi%2Fsars2pack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seandavi%2Fsars2pack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seandavi","download_url":"https://codeload.github.com/seandavi/sars2pack/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seandavi%2Fsars2pack/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268326453,"owners_count":24232478,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-01T02:00:08.611Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["biomedical-data","coronavirus","coronavirus-tracking","covid-19","data-science","data-visualization","datascience","datasets","epidemics","epidemiology","geospatial","public-health","rstats","rstats-package"],"created_at":"2024-11-05T13:16:29.148Z","updated_at":"2026-02-25T15:08:38.033Z","avatar_url":"https://github.com/seandavi.png","language":"R","readme":"---\noutput: \n  - rmarkdown::github_document\n  #- rmarkdown::html_document\nalways_allow_html: true\n  #bookdown::html_document2:\n    #number_sections: false\n    #toc: false\n---\n\n\n# sars2pack\n\n\u003c!-- badges: start --\u003e\n\n[![Launch Rstudio Binder](http://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/seandavi/sars2pack/master?urlpath=rstudio)\n[![R-CMD-check](https://github.com/seandavi/sars2pack/workflows/R-CMD-check/badge.svg)](https://github.com/seandavi/sars2pack/actions)\n\u003c!-- badges: end --\u003e\n\n```{r init, include=FALSE} \nknitr::opts_chunk$set(warning=FALSE,message=FALSE, cache=TRUE,\n                      fig.width=9, fig.height=6, out.width = '100%'\n                      )\nknitr::opts_knit$set(upload.fun = knitr::imgur_upload)\n```\n\n## Questions immediately addressed by sars2pack datasets\n\n- What are the current and historical total, new cases, and deaths of COVID-19 at the city, county, state, national, and international levels?\n- What are the non-pharmacological interventions in place at the local and national levels?\n- In the United States, what is the geographical distribution of healthcare capacity (ICU beds, total beds, doctors, etc.)?\n- What are the published values of key epidemic parameters, as curated from the literature?\n- When, where, and how are communities changing their movement patterns? \n\n## Installation\n\n```{r eval=FALSE}\n# If you do not have BiocManager installed:\ninstall.packages('BiocManager')\n\n# Then, if sars2pack is not already installed:\nBiocManager::install('seandavi/sars2pack')\n```\n\nAfter the one-time installation, load the packge to get started.\n\n```{r}\nlibrary(sars2pack)\n```\n\n## Available datasets\n\n```{r echo=FALSE}\nlibrary(knitr)\nlibrary(kableExtra)\nlibrary(tibble)\nlibrary(dplyr)\nlibrary(purrr)\nlibrary(sars2pack)\nlibrary(yaml)\nb = available_datasets()\nb %\u003e% dplyr::mutate(url=sprintf('[LINK](%s)',url)) %\u003e%\n    mutate_all(linebreak) %\u003e%\n    arrange(data_type) %\u003e%\n    kable(booktabs=TRUE, escape=FALSE) %\u003e%\n    kable_styling(\"striped\")\n```\n\n## Case tracking\n\nUpdated tracking  of city, county, state, national, and international confirmed cases, deaths,\nand testing is critical to driving policy, implementing interventions, and measuring their effectiveness. Case tracking datasets include date, a count of cases, deaths, testing, hospitalizations, and usually numerous other pieces of information related to location of reporting, etc. \n\nAccessing case-tracking datasets is typically done with one function per dataset. The example here is data from the European Centers for Disease Control, or ECDC.\n\n```{r worldwide}\necdc = ecdc_data()\n```\n\nGet a quick overview of the dataset.\n\n```{r}\nhead(ecdc)\n```\n\nThe `ecdc` dataset is just a `data.frame` (actually, a `tibble`), so applying standard R or tidyverse functionality can get answers to basic questions with little code. The next code block generates a `top10` of countries with the most deaths recorded to date. Note that if you do this on your own computer, the data will be updated to today's data values. \n\n```{r results='asis'}\nlibrary(dplyr)\ntop10 = ecdc %\u003e% filter(subset=='deaths') %\u003e% \n    group_by(location_name) %\u003e%\n    filter(count==max(count)) %\u003e%\n    arrange(desc(count)) %\u003e%\n    head(10) %\u003e% select(-starts_with('iso'),-continent,-subset) %\u003e%\n    mutate(rate_per_100k = 1e5*count/population_2019)\n\n```\n\nFinally, present a nice table of those countries:\n\n```{r}\nknitr::kable(\n    top10,\n    caption = \"Reported COVID-19-related deaths in ten most affected countries.\",\n    format = 'pandoc')\n```\n\nExamine the spread of the pandemic throughout the world by examining cumulative deaths\nreported for the top 10 countries above.\n\n```{r plotcases}\necdc_top10 = ecdc %\u003e% filter(location_name %in% top10$location_name \u0026 subset=='deaths')\nplot_epicurve(ecdc_top10,\n              filter_expression = count \u003e 10, \n              color='location_name')\n```\n\nComparing the features of disease spread is easiest if all curves are shifted to \n\"start\" at the same absolute level of infection. In this case, shift the origin for\nall countries to start at the first time point when more than 100 cumulative cases\nhad been observed. Note how some curves cross others which is evidence of less infection\ncontrol at the same relative time in the pandemic for that country (eg., Brazil).\n\n```{r}\necdc_top10 %\u003e% align_to_baseline(count\u003e100,group_vars=c('location_name')) %\u003e%\n    plot_epicurve(date_column = 'index',color='location_name')\n```\n\n\n\n\n## Contributions\n\nPull requests are gladly accepted on [Github](https://github.com/seandavi/sars2pack).\n\n### Adding new datasets\n\nSee the **Adding new datasets** vignette. \n\n## Similar work\n\n-   \u003chttps://github.com/emanuele-guidotti/COVID19\u003e\n-   [Top 25 R resources on Novel COVID-19\n    Coronavirus](https://towardsdatascience.com/top-5-r-resources-on-covid-19-coronavirus-1d4c8df6d85f)\n-   [COVID-19 epidemiology with\n    R](https://rviews.rstudio.com/2020/03/05/covid-19-epidemiology-with-r/)\n-   \u003chttps://github.com/RamiKrispin/coronavirus\u003e\n-   [Youtube: Using R to analyze\n    COVID-19](https://www.youtube.com/watch?v=D_CNmYkGRUc)\n-   [DataCamp: Visualize the rise of COVID-19 cases globally with\n    ggplot2](https://www.datacamp.com/projects/870)\n-   [MackLavielle/covidix R\n    package](https://github.com/MarcLavielle/covidix/)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseandavi%2Fsars2pack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseandavi%2Fsars2pack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseandavi%2Fsars2pack/lists"}