Skip to content

Commit

Permalink
Update workflow and typos
Browse files Browse the repository at this point in the history
  • Loading branch information
wklimowicz committed Aug 26, 2024
1 parent a50e824 commit ab3e069
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 21 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ on:
pull_request:
branches: [main, master]
schedule:
- cron: "0 0 * * 2" # Once every 2 weeks on monday
- cron: "0 0 1 * *" # Once a month, to catch bugs with package updates

name: R-CMD-check

name: R-CMD-check.yaml

permissions: read-all

jobs:
R-CMD-check:
Expand All @@ -31,7 +34,7 @@ jobs:
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

Expand All @@ -49,3 +52,4 @@ jobs:
- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ knitr::opts_chunk$set(
# tidylfs

<!-- badges: start -->
[![.github/workflows/R-CMD-check](https://github.com/wklimowicz/tidylfs/actions/workflows/.github/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/wklimowicz/tidylfs/actions/workflows/.github/workflows/R-CMD-check.yaml)
[![R-CMD-check](https://github.com/wklimowicz/tidylfs/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/wklimowicz/tidylfs/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->

## Installation
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<!-- badges: start -->

[![.github/workflows/R-CMD-check](https://github.com/wklimowicz/tidylfs/actions/workflows/.github/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/wklimowicz/tidylfs/actions/workflows/.github/workflows/R-CMD-check.yaml)
[![R-CMD-check](https://github.com/wklimowicz/tidylfs/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/wklimowicz/tidylfs/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->

## Installation
Expand Down Expand Up @@ -46,16 +46,16 @@ lfs <- lfs_compile(lfs_directory = "lfs_rds_folder/")

To reproduce official ONS publications, such as

- Unemployent [UNEM01
NSA](https://www.ons.gov.uk/employmentandlabourmarket/peoplenotinwork/unemployment/datasets/unemploymentbyageanddurationnotseasonallyadjustedunem01nsa)
- Unemployent [UNEM01
NSA](https://www.ons.gov.uk/employmentandlabourmarket/peoplenotinwork/unemployment/datasets/unemploymentbyageanddurationnotseasonallyadjustedunem01nsa)

``` r
lfs %>%
lfs_summarise_unemployment(QUARTER)
```

- Salary by occupation
[EARN06](https://www.ons.gov.uk/employmentandlabourmarket/peopleinwork/earningsandworkinghours/datasets/grossweeklyearningsbyoccupationearn06)
- Salary by occupation
[EARN06](https://www.ons.gov.uk/employmentandlabourmarket/peopleinwork/earningsandworkinghours/datasets/grossweeklyearningsbyoccupationearn06)

``` r
lfs %>%
Expand All @@ -68,7 +68,7 @@ lfs %>%

Extending them is easy:

- Unemployment by quarter, sex, and age category
- Unemployment by quarter, sex, and age category

``` r
lfs %>%
Expand Down
10 changes: 4 additions & 6 deletions vignettes/Adding_Variables.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,19 @@ knitr::opts_chunk$set(

# Overview

* tidylfs is designed to be easily extended. Adding variables and summaries is a few steps:

* `tidylfs` is designed to be easily extended. Adding variables and summaries is a few steps:
* Find the relevant variables in the [ONS LFS User guidance](https://www.ons.gov.uk/employmentandlabourmarket/peopleinwork/employmentandemployeetypes/methodologies/labourforcesurveyuserguidance).
* Add them to the function below.
* Load the function, and pass it as an argument to `lfs_compile`.


* For example, to add maritial status:
* For example, to add marital status:

```{r}
user_extra_mappings <- function(lfs_file_column_names) {
custom_variables <- tibble::tribble(
~lfs_name, ~new_name, ~type,
"MARSEX6", "SEX_AND_MARITIAL_STATUS", "factor"
"MARSEX6", "SEX_AND_MARITAL_STATUS", "factor"
)
return(custom_variables)
Expand All @@ -52,7 +50,7 @@ user_extra_mappings <- function(lfs_file_column_names) {
custom_variables <- tibble::tribble(
~lfs_name, ~new_name, ~type,
"MARSEX6", "SEX_AND_MARITIAL_STATUS", "factor",
"MARSEX6", "SEX_AND_MARITAL_STATUS", "factor",
degree_class, "DEGREE_CLASS", "factor"
)
Expand Down
10 changes: 5 additions & 5 deletions vignettes/Replicating_ONS_Publications.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ As part of the QA checks for this package there is code to replicate official ON

### EARN04

[Ons Publication](https://www.ons.gov.uk/employmentandlabourmarket/peopleinwork/earningsandworkinghours/datasets/grossweeklyearningsoffulltimeemployeesearn04)
[ONS Publication](https://www.ons.gov.uk/employmentandlabourmarket/peopleinwork/earningsandworkinghours/datasets/grossweeklyearningsoffulltimeemployeesearn04)

```{r}
lfs <- lfs_load()
Expand All @@ -34,7 +34,7 @@ As part of the QA checks for this package there is code to replicate official ON

### EARN06

[Ons Publication](https://www.ons.gov.uk/employmentandlabourmarket/peopleinwork/earningsandworkinghours/datasets/grossweeklyearningsbyoccupationearn06)
[ONS Publication](https://www.ons.gov.uk/employmentandlabourmarket/peopleinwork/earningsandworkinghours/datasets/grossweeklyearningsbyoccupationearn06)

```{r}
earn06 <- lfs %>%
Expand All @@ -51,7 +51,7 @@ As part of the QA checks for this package there is code to replicate official ON

### EARN07

[Ons Publication](https://www.ons.gov.uk/employmentandlabourmarket/peopleinwork/earningsandworkinghours/datasets/grossweeklyearningsbyindustryearn07)
[ONS Publication](https://www.ons.gov.uk/employmentandlabourmarket/peopleinwork/earningsandworkinghours/datasets/grossweeklyearningsbyindustryearn07)

Currently only accurate from 2009 onwards

Expand Down Expand Up @@ -91,7 +91,7 @@ Currently only accurate from 2009 onwards

### UNEM01 NSA

[Ons Publication](https://www.ons.gov.uk/employmentandlabourmarket/peoplenotinwork/unemployment/datasets/unemploymentbyageanddurationnotseasonallyadjustedunem01nsa)
[ONS Publication](https://www.ons.gov.uk/employmentandlabourmarket/peoplenotinwork/unemployment/datasets/unemploymentbyageanddurationnotseasonallyadjustedunem01nsa)

Accurate from 1995 onwards, also replicates sex splits when adding `SEX` as a grouping variable.

Expand All @@ -108,7 +108,7 @@ Accurate from 1995 onwards, also replicates sex splits when adding `SEX` as a gr

### HOUR01 NSA

[Ons Publication](https://www.ons.gov.uk/employmentandlabourmarket/peopleinwork/earningsandworkinghours/datasets/actualweeklyhoursworkednotseasonallyadjustedhour01nsa)
[ONS Publication](https://www.ons.gov.uk/employmentandlabourmarket/peopleinwork/earningsandworkinghours/datasets/actualweeklyhoursworkednotseasonallyadjustedhour01nsa)

```{r}
hour01 <- lfs %>%
Expand Down

0 comments on commit ab3e069

Please sign in to comment.