knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
The refresh_coronavirus_jhu
function enables to pull the coronavirus
dataset using the Covid19R project data format standard. This data format includes the following fields:
date
- The date of the observation, using Date
classlocation
- The name of the location as provided by John Hopkins raw datalocation_type
- The type of the location field, either country
or state
location_code
- The location code, using the ios_3166_2
formatlocation_code_type
- The location code type (ios_3166_2
)data_type
- The case type, c("recovered_new", "cases_new", "deaths_new" )
value
- The number of caseslat
- The latitude codelong
- The longitude codelibrary(coronavirus) covid19_df <- refresh_coronavirus_jhu() #> Parsed with column specification: #> cols( #> date = col_date(format = ""), #> province = col_character(), #> country = col_character(), #> lat = col_double(), #> long = col_double(), #> type = col_character(), #> cases = col_double() #> ) #> Parsed with column specification: #> cols( #> location = col_character(), #> location_code = col_character(), #> location_code_type = col_character() #> ) head(covid19_df) #> date location location_type location_code location_code_type data_type value lat long #> 1 2020-10-10 Alberta, Canada state CA-AB iso_3166_2 deaths_new 0 53.9333 -116.5765 #> 2 2020-08-09 Alberta, Canada state CA-AB iso_3166_2 cases_new 0 53.9333 -116.5765 #> 3 2020-10-21 Alberta, Canada state CA-AB iso_3166_2 cases_new 406 53.9333 -116.5765 #> 4 2020-06-15 Alberta, Canada state CA-AB iso_3166_2 deaths_new 1 53.9333 -116.5765 #> 5 2020-06-13 Alberta, Canada state CA-AB iso_3166_2 cases_new 37 53.9333 -116.5765 #> 6 2020-06-21 Alberta, Canada state CA-AB iso_3166_2 cases_new 31 53.9333 -116.5765
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.