Skip to content

Commit

Permalink
version 1.8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Warsame Yusuf authored and cran-robot committed Jun 23, 2021
1 parent 909053e commit e7b66d6
Show file tree
Hide file tree
Showing 13 changed files with 504 additions and 477 deletions.
8 changes: 4 additions & 4 deletions DESCRIPTION
@@ -1,8 +1,8 @@
Package: cchsflow
Type: Package
Title: Transforming and Harmonizing CCHS Variables
Version: 1.8.0
Date: 2021-01-22
Version: 1.8.2
Date: 2021-06-23
Authors@R: c(
person(given = "Doug",
family = "Manuel",
Expand Down Expand Up @@ -47,7 +47,7 @@ BugReports: https://github.com/Big-Life-Lab/cchsflow/issues
RoxygenNote: 7.1.1
Suggests: testthat (>= 2.1.0)
NeedsCompilation: no
Packaged: 2021-01-24 17:49:17 UTC; warsameyusuf
Packaged: 2021-06-23 18:13:57 UTC; warsameyusuf
Author: Doug Manuel [aut, cph] (<https://orcid.org/0000-0003-0912-0845>),
Warsame Yusuf [aut, cre],
Rostyslav Vyuha [aut],
Expand All @@ -56,4 +56,4 @@ Author: Doug Manuel [aut, cph] (<https://orcid.org/0000-0003-0912-0845>),
The Ottawa Hospital [cph]
Maintainer: Warsame Yusuf <waryusuf@ohri.ca>
Repository: CRAN
Date/Publication: 2021-01-24 18:10:05 UTC
Date/Publication: 2021-06-23 18:30:02 UTC
24 changes: 12 additions & 12 deletions MD5
@@ -1,10 +1,10 @@
08ef35e3f7879240d827e1d400a191fe *DESCRIPTION
e0a4730eb406be4bbe92a80c486ddf75 *DESCRIPTION
c083aa5c8bb27f66ab606ddf66c2701f *LICENSE
c36d37857679417aefec7d889015316a *NAMESPACE
136c647c69cd573f1b12b099a38b254f *NEWS.md
2cb71a388db36109d8dd079bff739ee1 *NEWS.md
450c5a3f6b39c2415e0f15891565ef85 *R/RACDPAL.R
aff2b31c9973eb33d5206a3bc4e82e99 *R/adl.R
cb750743c89f8628f5a12bf5aacb93ce *R/age-categorical.R
a621a5dde142f1667a30db2b1873635a *R/age-categorical.R
6cdfe5d0e2d11a148ac7d18589ea53b7 *R/alcohol.R
54937ab32e2bdb16a1ee63e8b9d8afb0 *R/bmi.R
3ece39ac9fea664ec2b5b5fdec0a9b06 *R/data.R
Expand All @@ -19,10 +19,10 @@ ccb89744a9890b0bda619fc59071136b *R/occupation.R
b32e48650ef091dbe2a1721cbe782a52 *R/percent-time-canada.R
06d30768eb4bec8fdc65e2788286c2c8 *R/recode-with-table.R
2add694d260ed594146401e15d532f56 *R/respiratory-condition.R
8c4ee6e754abb66657b436f6873e895a *R/smoking.R
578a4473ad40ceae0bc293d54711cd1a *R/smoking.R
32174c09c8d3da1bdbbad5f9ef5f8d77 *R/strings.R
8bf8ffe54475d13a920b221fb152c155 *R/utility-functions.R
e9775885142fd0b418cc0aaf8ff86d24 *README.md
9cba9ec19eac54d352ffd42515fb62af *README.md
5522b404dd52c7f407d763174b1a77a7 *data/cchs2001_p.RData
7d53f090c32110bf0f1ff479e29a46d8 *data/cchs2003_p.RData
6c848d7badcb53f771f48a788a243ed5 *data/cchs2005_p.RData
Expand All @@ -33,12 +33,12 @@ ec929cfa9015879b60b281daebbeac5b *data/cchs2011_2012_p.RData
d29ca31ea98b67f883127d6979729113 *data/cchs2012_p.RData
a56f9bea2c831b642996051f5b766221 *data/cchs2013_2014_p.RData
9fbdaa97ea18e840742bb4426e4d4742 *data/cchs2014_p.RData
5e3060f9f4af2c1a3f32dce54087f899 *data/variable_details.RData
8c2d5719f25f4ad658e31e7e38aa0b87 *data/variables.RData
930371009acc967cda6c9106ac8c8320 *data/variable_details.RData
e07c0147d3f00dfafa1a6f7e48f9c0ce *data/variables.RData
f8428dd67649912b586c58309d7a5b23 *inst/extdata/sample_variable_details.csv
c09e3562d8cd8c4d9f9670a5bc9512e3 *inst/extdata/sample_variables.csv
33cd957d20f0c8119321e335ddffc684 *inst/extdata/variable_details.csv
ad49abcf0ee4c7e143a614acf86f1232 *inst/extdata/variables.csv
40c8c32fb3acfc63676d30b254105b13 *inst/extdata/variable_details.csv
42f5a93e58133bd611e5fe52fa945f30 *inst/extdata/variables.csv
94e0e8f6b9c1ea6cbb0e7c5133ddf17c *man/ALCDTTM.Rd
77b57a721005d82cd86aadb24c6620bf *man/ALCDTYP.Rd
e775c56d032f1f8c765101ce2fc59144 *man/ALWDDLY.Rd
Expand Down Expand Up @@ -78,7 +78,7 @@ b9d348335f7d4b526d69ed2d6c917e47 *man/compare_value_based_on_interval.Rd
af588d36573b4ad1b127a40e209f5a55 *man/merge_rec_data.Rd
fe7b553bac4709964f852c55fbcf1d8a *man/multiple_conditions_fun1.Rd
23e9a7690cc007e9508fb592c770fb22 *man/multiple_conditions_fun2.Rd
c1432b81620db8f11aaa689f04b3d5f1 *man/pack_years_fun.Rd
ec3246a50d105b81a390a5c18b549430 *man/pack_years_fun.Rd
d9b7397d322d3f83b371b5024e357816 *man/pct_time_fun.Rd
8af6bba5c5dc448e563b9a950d3372f0 *man/rec_with_table.Rd
28b0a4436d5e082944a22eec32c3d39a *man/recode_columns.Rd
Expand All @@ -88,10 +88,10 @@ d9b7397d322d3f83b371b5024e357816 *man/pct_time_fun.Rd
f36d340a3b73dbe51251e4b730531b42 *man/resp_condition_fun3.Rd
e5a35ead870dbd73eb4fbad4f6c56ca2 *man/set_data_labels.Rd
ff84b5ad946983c37a3e82aac108a0c9 *man/smoke_simple_fun.Rd
748a3bbe432a1ffea07224b34180ff34 *man/time_quit_smoking_fun.Rd
4a04dd8ee058a5e3c22d427383d3840d *man/time_quit_smoking_fun.Rd
8e321443ace94560a0ebb5c2a900925c *man/variable_details.Rd
66f922c7b6083dc6b24547441ad5f104 *man/variables.Rd
22f6536775da71d5d81a15ea12055572 *tests/testdata/rec_with_table_test_data.RData
fd9595ab3bc38bc7fb4b6b1b95ac9727 *tests/testdata/rec_with_table_test_data.RData
43d2fa2171d3036ee5de527de1eb0a6b *tests/testthat.R
e73a51c0af5181e2cb88721b998f6c28 *tests/testthat/test-RACDPAL.R
c1a4b4364860595a4e51820605c60b0a *tests/testthat/test-adl.R
Expand Down
16 changes: 16 additions & 0 deletions NEWS.md
@@ -1,3 +1,19 @@
# cchsflow 1.8.2
2021-06-23

## Bug Fixes
- Fixes to `age_cat_fun()` to support decimal values from `DHHGAGE_cont`.
- Documentation corrections to `pack_years_fun()` and `time_quit_smoking_fun()`.

## New variable
- **SMKDSTY_cat3**: 3 category smoking status derived variable.

# cchsflow 1.8.1
2021-01-25

## Bug Fixes
- Correct breaking specification errors for [diet_score](https://big-life-lab.github.io/cchsflow/reference/diet_score_fun.html).

# cchsflow 1.8.0
2021-01-22

Expand Down
40 changes: 21 additions & 19 deletions R/age-categorical.R
Expand Up @@ -54,38 +54,40 @@
#'
#' @export
age_cat_fun <- function(DHHGAGE_cont) {
if_else2(
(DHHGAGE_cont %in% 12:14), 1,
age_cat <-
if_else2(
(DHHGAGE_cont %in% 15:17), 2,
dplyr::between(DHHGAGE_cont, 12, 14), 1,
if_else2(
(DHHGAGE_cont %in% 18:19), 3,
dplyr::between(DHHGAGE_cont, 15, 17), 2,
if_else2(
(DHHGAGE_cont %in% 20:24), 4,
dplyr::between(DHHGAGE_cont, 18, 19), 3,
if_else2(
(DHHGAGE_cont %in% 25:29), 5,
dplyr::between(DHHGAGE_cont, 20, 24), 4,
if_else2(
(DHHGAGE_cont %in% 30:34), 6,
dplyr::between(DHHGAGE_cont, 25, 29), 5,
if_else2(
(DHHGAGE_cont %in% 35:39), 7,
dplyr::between(DHHGAGE_cont, 30, 34), 6,
if_else2(
(DHHGAGE_cont %in% 40:44), 8,
dplyr::between(DHHGAGE_cont, 35, 39), 7,
if_else2(
(DHHGAGE_cont %in% 45:49), 9,
dplyr::between(DHHGAGE_cont, 40, 44), 8,
if_else2(
(DHHGAGE_cont %in% 50:54), 10,
dplyr::between(DHHGAGE_cont, 45, 49), 9,
if_else2(
(DHHGAGE_cont %in% 55:59), 11,
dplyr::between(DHHGAGE_cont, 50, 54), 10,
if_else2(
(DHHGAGE_cont %in% 60:64), 12,
dplyr::between(DHHGAGE_cont, 55, 59), 11,
if_else2(
(DHHGAGE_cont %in% 65:69), 13,
dplyr::between(DHHGAGE_cont, 60, 64), 12,
if_else2(
(DHHGAGE_cont %in% 70:74), 14,
dplyr::between(DHHGAGE_cont, 65, 69), 13,
if_else2(
(DHHGAGE_cont %in% 75:79), 15,
if_else2((DHHGAGE_cont >= 80), 16,
"NA(b)")
dplyr::between(DHHGAGE_cont, 70, 74), 14,
if_else2(
dplyr::between(DHHGAGE_cont, 75, 79), 15,
if_else2((DHHGAGE_cont >= 80), 16,
"NA(b)")
)
)
)
)
Expand All @@ -100,5 +102,5 @@ age_cat_fun <- function(DHHGAGE_cont) {
)
)
)
)
return(age_cat)
}
13 changes: 7 additions & 6 deletions R/smoking.R
Expand Up @@ -19,23 +19,24 @@
#' # time_quit_smoking_fun() is specified in variable_details.csv along with the
#' # CCHS variables and cycles included.
#'
#' # To transform time_quit_fun across cycles, use rec_with_table() for each
#' # CCHS cycle and specify time_quit_fun, along with each smoking variable.
#' # Then by using merge_rec_data(), you can combine time_quit_fun across cycles
#' # To transform time_quit_smoking across cycles, use rec_with_table() for each
#' # CCHS cycle and specify time_quit_smoking, along with each smoking variable.
#' # Then by using merge_rec_data(), you can combine time_quit_smoking across
#' # cycles.
#'
#' library(cchsflow)
#'
#' time_quit2009_2010 <- rec_with_table(
#' cchs2009_2010_p, c(
#' "SMK_09A_B", "SMKG09C", "time_quit_smoking_der."
#' "SMK_09A_B", "SMKG09C", "time_quit_smoking"
#' )
#' )
#'
#' head(time_quit2009_2010)
#'
#' time_quit2011_2012 <- rec_with_table(
#' cchs2011_2012_p, c(
#' "SMK_09A_B", "SMKG09C", "time_quit_smoking_der."
#' "SMK_09A_B", "SMKG09C", "time_quit_smoking"
#' )
#' )
#'
Expand Down Expand Up @@ -220,7 +221,7 @@ smoke_simple_fun <-
#'
#' @param SMKG01C_cont age smoked first cigarette
#'
#' @return value for smoking pack-years in the Pack_years_der variable
#' @return value for smoking pack-years in the pack_years_der variable
#'
#' @examples
#' # Using pack_years_fun() to create pack-years values across CCHS cycles
Expand Down
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -83,7 +83,7 @@ in 2001 CCHS"
other forms of bias that affects studies in different ways.* The transformations
that are described in this repository have been used in several research
projects, but there are no guarantees regarding the accuracy or appropriate
uses.
uses. [Thomas and Wannell](https://www150.statcan.gc.ca/n1/en/pub/82-003-x/82-003-x2009001-eng.pdf?st=_n9lb9N4) describe methodolgy issues when combining CCHS cycles.

Care must be taken to understand how specific variable transformation and
harmonization with `cchsflow` affect your study or use of CCHS data. Across
Expand All @@ -102,7 +102,7 @@ affect responses.
devtools::install_github("Big-Life-Lab/cchsflow")
```

Do you just want new variables not yet added to the CRAN version?
#### New variables not yet added to the CRAN version

You can download and use the latest version of
[`variables.csv`](https://github.com/Big-Life-Lab/cchsflow/blob/master/inst/extdata/variables.csv)
Expand Down
Binary file modified data/variable_details.RData
Binary file not shown.
Binary file modified data/variables.RData
Binary file not shown.

0 comments on commit e7b66d6

Please sign in to comment.