forked from reichlab/covidData
-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (64 loc) · 3.15 KB
/
update_time_series_links.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Update time series links
on:
workflow_dispatch:
inputs:
name:
description: 'Update time series data links'
required: false
schedule:
- cron: "0 0 * * *"
- cron: "0 17 * * *"
jobs:
update_time_series_links:
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", "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