Skip to content

Update time series links csv #927

Update time series links csv

Update time series links csv #927

name: Update time series links csv
on:
workflow_dispatch:
inputs:
name:
description: 'Update time series data links'
required: false
schedule:
- cron: "10 0 * * *"
- cron: "10 17 * * *"
jobs:
update_time_series_links_csv:
runs-on: macOS-latest
steps:
- name: Checkout covidData repo
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup R
uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- name: Install dependencies
run: |
install.packages(c("tidyverse", "dplyr", "httr", "readr", "here", "tidyr", "RSocrata"))
shell: Rscript {0}
- name: Update time series
run: |
library(httr)
library(RSocrata)
library(dplyr)
library(here)
setwd(here())
source("R/get_time_series_data_link.R")
# get US data links
jhu_us_deaths_data_links <- get_time_series_data_link(measure = "deaths",
geography = "US",
download_files = FALSE,
download_recent = FALSE)
write.csv(jhu_us_deaths_data_links, file = "data/jhu_us_deaths_data_links.csv", row.names = FALSE)
jhu_us_cases_data_links <- get_time_series_data_link(measure = "cases",
geography = "US",
download_files = FALSE,
download_recent = FALSE)
write.csv(jhu_us_cases_data_links, file = "data/jhu_us_cases_data_links.csv", row.names = FALSE)
# get global data links
jhu_global_deaths_data_links <- get_time_series_data_link(measure = "deaths",
geography = "global",
download_files = FALSE,
download_recent = FALSE)
write.csv(jhu_global_deaths_data_links, file = "data/jhu_global_deaths_data_links.csv", row.names = FALSE)
jhu_global_cases_data_links <- get_time_series_data_link(measure = "cases",
geography = "global",
download_files = FALSE,
download_recent = FALSE)
write.csv(jhu_global_cases_data_links, file = "data/jhu_global_cases_data_links.csv", row.names = FALSE)
shell: Rscript {0}
- name: Commit changes
uses: EndBug/add-and-commit@v7
with:
add: '["data/jhu_us_cases_data_links.csv", "data/jhu_us_deaths_data_links.csv", "data/jhu_global_cases_data_links.csv", "data/jhu_global_deaths_data_links.csv"]'
message: "Update time series data links"
default_author: github_actions
push: true