Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
351bfac
Added new metadata columns to the variables sheet
yulric Nov 18, 2025
7af4614
Added a new column to the variables sheet for review information
yulric Nov 18, 2025
7c84d6f
Added new column to variables sheet 'ICES.confirmation'
yulric Nov 18, 2025
27cc85f
Added new column to variables sheet 'Observation..MD.'
yulric Nov 18, 2025
d7fc97d
Added new versioning columns to the variable details sheet
yulric Nov 18, 2025
ca89d96
Added new review columns to the variable details sheet
yulric Nov 18, 2025
666e7e6
Added new column 'ICES.confirmation' to the variables sheet
yulric Nov 18, 2025
5e028b6
Reordered columns in the variable details sheet
yulric Nov 18, 2025
1a01572
Reordered the columns in the variables sheet
yulric Nov 18, 2025
5961c34
Created quarto project for the enhancement proposals
yulric Nov 20, 2025
0f501af
Add CEP 1: CSV Worksheet Standardization Tool
yulric Oct 16, 2025
4c7575a
Added instructions on working with the file in the repo
yulric Nov 20, 2025
f0cb30d
Added a new function to check a variables and variable details sheet …
yulric Nov 27, 2025
9d476ae
Added script that uses the check_worksheet function on the worksheets…
yulric Dec 2, 2025
9e42994
Refactored the `create_test_csv` function from the `check_worksheet` …
yulric Dec 10, 2025
cba3145
Added a new function that fixes formatting issues in a variables and …
yulric Dec 10, 2025
7ef17f0
Added script to fix the formatting of the variables and variable deta…
yulric Jan 9, 2026
6cc330d
Added a new Github action to check the repo's variables and variable …
yulric Dec 22, 2025
3ebdfd3
Documented missing packages
yulric Dec 29, 2025
44f3e24
Updated Roxygen
yulric Dec 29, 2025
f8ba13a
Fixed formatting issues with variables and variable details worksheet
yulric Dec 23, 2025
8dc8c30
Fix bug in recode-with-table with derived variables
yulric Dec 29, 2025
d2ce593
Added documentation to the website regarding the new formatting funct…
yulric Dec 29, 2025
d7d954f
Add instructions about implicit return when writing R code
yulric Jan 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/check-csv.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Check CSV Formatting

on:
pull_request:
paths:
- 'inst/extdata/variables.csv'
- 'inst/extdata/variable_details.csv'
push:
branches:
- main
paths:
- 'inst/extdata/variables.csv'
- 'inst/extdata/variable_details.csv'

jobs:
check-csv-formatting:
runs-on: ubuntu-latest
name: Validate CSV worksheet formatting

steps:
- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8

- name: Set up R
uses: r-lib/actions/setup-r@6f6e5bc62fba3a704f74e7ad7ef7676c5c6a2590
with:
r-version: 'release'

- name: Install package dependencies
uses: r-lib/actions/setup-r-dependencies@6f6e5bc62fba3a704f74e7ad7ef7676c5c6a2590
with:
extra-packages: local::.

- name: Check CSV formatting
run: Rscript exec/check-worksheets.R

- name: Suggest fix command on failure
if: failure()
run: |
echo "::error::CSV formatting violations detected. Run 'Rscript exec/fix-worksheets.R' locally to fix them."
10 changes: 10 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

This page outlines how to contribute to the `cchsflow` package.

## Working with repo

When working with the files within a folder, make sure to follow the
instructions within the README.md file in that folder and folders above it if
they exist.

## Naming files

Use kebab case when naming files. For example, `smoking-functions.R`

## Adding variables to cchsflow

### Transforming existing CCHS variables
Expand Down
8 changes: 6 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ Depends:
dplyr (>= 0.8.2),
sjlabelled (>= 1.0.17),
stringr (>= 1.2.0),
magrittr
magrittr,
yaml,
readr,
purrr,
cli
Description: Supporting the use of the Canadian Community Health Survey
(CCHS) by transforming variables from each cycle into harmonized,
consistent versions that span survey cycles (currently, 2001 to
Expand All @@ -53,7 +57,7 @@ Encoding: UTF-8
LazyData: true
URL: https://big-life-lab.github.io/cchsflow/, https://github.com/Big-Life-Lab/cchsflow
BugReports: https://github.com/Big-Life-Lab/cchsflow/issues
RoxygenNote: 7.1.2
RoxygenNote: 7.3.3
Suggests:
testthat (>= 3.0.0)
Config/testthat/edition: 3
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ export(age_cat_fun)
export(binge_drinker_fun)
export(bmi_fun)
export(bmi_fun_cat)
export(check_worksheet)
export(diet_score_fun)
export(diet_score_fun_cat)
export(energy_exp_fun)
export(fix_worksheet)
export(food_insecurity_der)
export(if_else2)
export(immigration_fun)
Expand Down
30 changes: 30 additions & 0 deletions R/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
## Naming files

Files that contain a single public function should be named the same as the
function but follow kebab case. For example, if the name of the public function
is `pack_years_fun` then the file should be named `pack-years-fun.R`.

## Naming private functions

Functions that are not meant to be used by a package user should be named
starting with a dot. For example, `.validate_function_args`.

## Implicit Return

Do not use implicit returns, instead explicitly use the `return` function.

DO NOT DO THIS

```{r}
sum <- function(a, b) {
a + b
}
```

DO THIS

```{r}
sum <- function(a, b) {
return(a + b)
}
```
Loading