I hereby claim:
- I am ryanleewatts on github.
- I am ryanleewatts (https://keybase.io/ryanleewatts) on keybase.
- I have a public key ASBNVxcFA4M0b1_UKKftYfc4LeS6IvpXBEmHIKtVOxmPVQo
To claim this, I am signing this object:
# Check if we have new data | |
library(pacman) | |
p_load("slackr", "naptime", "lubridate") | |
# Set up a repeating loop | |
repeat{ | |
# Check the current time | |
start_time <- lubridate::now() | |
# Download and read the file | |
download.file("https://coronavirus.data.gov.uk/downloads/csv/coronavirus-cases_latest.csv", "export/phe_data.csv", method = "libcurl") | |
data <- read.csv("export/phe_data.csv") |
# Update our worldwide cases chart | |
# We would replace `chartid` below with the chart’s Datawrapper id | |
# https://app.datawrapper.de/chart/chartid/publish | |
# Clean our data and get it ready for the chart | |
chartid <- data %>% | |
group_by(date) %>% | |
# reshape so "cases" is one column and "deaths" is another | |
dcast(date ~ variable, value.var = "value", fun.aggregate = sum) %>% | |
select(date, `Confirmed cases`, Deaths = deaths) |
I hereby claim:
To claim this, I am signing this object: