-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
89 lines (54 loc) · 3.72 KB
/
README.Rmd
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# djprdashdata
<!-- badges: start -->
[![R-CMD-check](https://github.com/djpr-data/djprdashdata/workflows/R-CMD-check/badge.svg)](https://github.com/djpr-data/djprdashdata/actions)
[![refresh-data](https://github.com/djpr-data/djprdashdata/workflows/refresh-data/badge.svg)](https://github.com/djpr-data/djprdashdata/actions)
<!-- badges: end -->
## Overview
This R package contains functions to download, tidy, and store data from the ABS and other public data sources.
The `data-raw/refresh_data.R` file contains code to download public data using the package's functions. The data itself is saved in `data-raw`.
This public data is used in the DJSIR Jobs Dashboard. See:
- The [`djprlabourdash`](https://github.com/djpr-data/djprlabourdash) GitHub repo for the Jobs Dashboard code; and
- The [live dashboard](https://djpr-spp.shinyapps.io/djprlabourdash/).
## Last refresh date
The `refresh_data.R` script is executed on a schedule using GitHub Actions.
```{r, include=FALSE}
ref_date <- readLines(here::here("data-raw", "last_refreshed.txt")) |>
lubridate::ymd_hms() |>
lubridate::with_tz("Australia/Melbourne") |>
as.character(usetz = T)
update_date <- readLines(here::here("data-raw", "last_updated.txt")) |>
lubridate::ymd_hms() |>
lubridate::with_tz("Australia/Melbourne") |>
as.character(usetz = T)
```
The last time the script was run to check for new data was `r ref_date`.
The last time new data was found was `r update_date`.
## Modifying the data stored in this repository
The file `abs-lfs.qs` in the `data-raw/abs-ts` sub-folder of this repository is the data loaded by the DJPR Jobs Dashboard.
This is a subset of the publicly-available ABS labour force survey data. The file is loaded by the dashboard using the `djprlabourdash::load_dash_data()` command.
The `refresh_data.R` script defines which series from the labour force survey are included in `abs-lfs.qs` and therefore available to the DJPR Jobs Dashboard. To add time series to this file, follow these steps:
1. Ensure you have the `djprdashdata` repository on your local machine. You only need to do this step once. In RStudio, click `File` -\> `New Project` -\> `Version Control` -\> `Git`. Then paste the GitHub repository URL for `djprdashdata` and choose a location for the project on your disk;
2. Create a new branch on GitHub in the `djprdashdata` from the `main` branch;
3. In RStudio, working in the `djprdashdata` project, click the `Git` pane, then `Pull`;
4. In RStudio, in the `Git` pane, switch to your newly-created branch;
5. Open the `refresh_data.R` file in the `data-raw` folder;
6. At the top of the script, a vector of ABS time series IDs is defined. This is a complete list of all ABS time series IDs that are included in the dashboard data. Add any additional required IDs to this vector;
7. Save the `refresh_data.R` file;
8. With `refresh_data.R` open, click `Source` in RStudio. This should be at the top of the script window;
9. R will now run the `refresh_data.R` script. If it does not encounter any errors, the data in the project will update. You should see console output that ends with something like this;
![](images/Screen%20Shot%202021-07-28%20at%2010.55.44%20am.png)
10. In the `Git` pane of RStudio, stage and commit all modified files, then `Push` the changes;
11. In `GitHub` initiate a pull request from your branch to `main` and request a review of this pull request.
Once the PR has been approved, your modifications to the data will be available to the DJPR Jobs Dashboard.