We collect several ways to get the 2019-nCoV epidemic data.
Use the R ncovr package
R users can get the epidemic data via the ncovr package we develop, which basically includes the datasets described later.
# Install the remotes package
install.packages('remotes')
# Install the ncovr package
remotes::install_github('pzhaonet/ncovr')
# windows users have to set the Chinese environment
Sys.setlocale('LC_CTYPE', 'Chinese')
# Load the ncovr package
require("ncovr")
# read RDS data (default;recommended)
get_ncov()
# read .csv files (recommended)
get_ncov(method = 'csv')
# read from api
get_ncov(method = 'api')
Please see the help documents for more details.
Download directly
Non-R users can download the .csv files directly from the repository BlankerL/DXY-2019-nCoV-Data, and then open it with tools such as Excel.
This repository provides .json files as well.
An Excel spreadsheet of daily national data can be downloaded from the JackieZheng/2019-nCoV. This project also provides other data format with the same content.
It would be appreciated if you let us know other data sources, which will be listed here.
Use the R nCov2019 package
nCov2019 is another R package for downloading data.
remotes::install_github("GuangchuangYu/nCov2019")
library(nCov2019)
x <- get_nCov2019()
x
time(x)
x[]
More details can be found on its GitHub repo.
Introduction to R
R is a free and open-source software package. We use R for data collection, cleaning, and visualization, as well as developing models, building this website, and automatically updating.
For R beginners, we published a book Learning R: from the very beginning (Peng Zhao and Yi Li. Research Press,2018. In Chinese). Click the following image and visit the homepage and read sample chapters for free.