Skip to content

Commit 82f0b15

Browse files
committed
Restored original favicons, simplified function titles in documentations, and added rest of cchsflow badges in README
1 parent fdaa7c4 commit 82f0b15

File tree

106 files changed

+277
-377
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+277
-377
lines changed

R/alcohol.R

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#' @title Calculate the Low Drink Score for a CHMS Respondent Based on Alcohol Consumption
1+
#' @title Low risk drinking score
22
#'
33
#' @description
44
#' This function calculates a low drink score (step 1 only) for a respondent using
@@ -85,7 +85,7 @@ low_drink_score_fun <- function(CLC_SEX, ALC_11, ALCDWKY) {
8585
return(low_drink_score)
8686
}
8787

88-
#' @title Calculate Low Drink Score According to Canada's Low-Risk Drinking Guidelines
88+
#' @title Low risk drinking score - former/never categories
8989
#'
9090
#' @description
9191
#' Computes a categorical alcohol consumption score based on Canada's Low-Risk Alcohol Drinking Guidelines (Step 1),
@@ -122,18 +122,13 @@ low_drink_score_fun <- function(CLC_SEX, ALC_11, ALCDWKY) {
122122
#'
123123
#' \strong{Step 2: Determine the final categorical score.}
124124
#' \itemize{
125-
#' \item If Step 1 = 0:
125+
#' \item If the point score from Step 1 is 0, the final category is determined based on lifetime and past-year drinking habits:
126126
#' \itemize{
127-
#' \item If ALC_17 == 2 and ALC_11 == 2: score = 1
128-
#' \item If ALC_17 == 1 and ALC_11 == 2:
129-
#' \itemize{
130-
#' \item ALC_18 == 2: score = 1
131-
#' \item ALC_18 == 1: score = 2
132-
#' }
133-
#' \item If ALC_11 == 1: score = 2
127+
#' \item A score of 1 (Never drinker) is assigned if the respondent either never drank alcohol in their lifetime or is a former drinker who did not regularly consume more than 12 drinks a week.
128+
#' \item A score of 2 (Low-risk drinker) is assigned if the respondent drank in the past year (but still scored 0 points) or is a former drinker with a history of regularly consuming more than 12 drinks a week.
134129
#' }
135-
#' \item If Step 1 = 1 or 2: score = 3
136-
#' \item If Step 1 is 3 or more: score = 4
130+
#' \item If the point score from Step 1 is 1 or 2, the respondent is classified as a \strong{Moderate drinker} (Score = 3).
131+
#' \item If the point score from Step 1 is 3 or more, the respondent is classified as a \strong{Heavy drinker} (Score = 4).
137132
#' }
138133
#'
139134
#' @note

R/blood-pressure.R

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#' @title Adjust systolic blood pressure
1+
#' @title Adjusted systolic blood pressure
22
#'
33
#' @description This function adjusts systolic blood pressure based on the respondent's systolic average blood pressure across
44
#' six measurements. The adjustment is made using specific correction factors. The adjusted systolic blood pressure
@@ -33,7 +33,7 @@ adjust_SBP <- function(BPMDPBPS) {
3333
return(SBP_adj)
3434
}
3535

36-
#' @title Adjust diastolic blood pressure
36+
#' @title Adjusted diastolic blood pressure
3737
#'
3838
#' @description This function adjusts diastolic blood pressure based on the respondent's diastolic average blood pressure across
3939
#' six measurements. The adjustment is made using specific correction factors. The adjusted diastolic blood pressure
@@ -68,7 +68,7 @@ adjust_DBP <- function(BPMDPBPD) {
6868
return(DBP_adj)
6969
}
7070

71-
#' @title Determine Hypertension Status
71+
#' @title Hypertension derived variable
7272
#'
7373
#' @description
7474
#' This function determines the hypertension status of a respondent based on their systolic and diastolic blood pressure measurements and medication usage.
@@ -177,10 +177,10 @@ determine_hypertension <- function(BPMDPBPS, BPMDPBPD, ANYMED2, CCC_32 = 2, CARD
177177
return(highBP14090)
178178
}
179179

180-
#' @title Determine Adjusted Hypertension Status
180+
#' @title Hypertension derived variable with adjusted blood pressures
181181
#'
182182
#' @description
183-
#' This function determines the adjusted hypertension status of a respondent based on their adjusted systolic and diastolic blood pressure measurements and medication usage.
183+
#' This function determines the hypertension status of a respondent based on their adjusted systolic and diastolic blood pressure measurements and medication usage.
184184
#'
185185
#' @param SBP_adj An integer representing the adjusted systolic blood pressure measurement of the respondent.
186186
#' @param DBP_adj An integer representing the adjusted diastolic blood pressure measurement of the respondent.
@@ -286,7 +286,7 @@ determine_adjusted_hypertension <- function(SBP_adj, DBP_adj, ANYMED2, CCC_32 =
286286
return(highBP14090_adj)
287287
}
288288

289-
#' @title Determine Controlled Hypertension Status
289+
#' @title Controlled hypertension derived variable
290290
#'
291291
#' @description
292292
#' This function determines the controlled hypertension status of a respondent based on their systolic and diastolic blood pressure measurements and medication usage.
@@ -388,10 +388,10 @@ determine_controlled_hypertension <- function(BPMDPBPS, BPMDPBPD, ANYMED2, CCC_3
388388
return(Control14090)
389389
}
390390

391-
#' @title Determine Controlled Adjusted Hypertension Status
391+
#' @title Controlled hypertension derived variable with adjusted blood pressures
392392
#'
393393
#' @description
394-
#' This function determines the controlled adjusted hypertension status of a respondent based on their adjusted systolic and diastolic blood pressure measurements and medication usage.
394+
#' This function determines the controlled hypertension status of a respondent based on their adjusted systolic and diastolic blood pressure measurements and medication usage.
395395
#'
396396
#' @param SBP_adj An integer representing the adjusted systolic blood pressure measurement of the respondent.
397397
#' @param DBP_adj An integer representing the adjusted diastolic blood pressure measurement of the respondent.

R/cholesterol-and-obesity.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#' @title Calculate Non-HDL Cholesterol Level
1+
#' @title Non-HDL cholesterol level
22
#'
33
#' @description This function calculates a respondent's non-HDL cholesterol level by subtracting their HDL cholesterol level
44
#' from their total cholesterol level. It first checks whether the input values `LAB_CHOL` (total cholesterol)
@@ -36,9 +36,9 @@ calculate_nonHDL <- function(LAB_CHOL, LAB_HDL) {
3636
return(nonHDL)
3737
}
3838

39-
#' Non-HDL Cholesterol Categorization
39+
#' @title Categorical non-HDL cholesterol level
4040
#'
41-
#' This function categorizes individuals' non-HDL cholesterol levels based on a threshold value.
41+
#' @description This function categorizes individuals' non-HDL cholesterol levels based on a threshold value.
4242
#'
4343
#' @param nonHDL Numeric value representing an individual's non-HDL cholesterol level.
4444
#'
@@ -72,7 +72,7 @@ categorize_nonHDL <- function(nonHDL) {
7272
return(nonhdltodd)
7373
}
7474

75-
#' @title Calculate Waist-to-Height Ratio (WHR)
75+
#' @title Waist-to-height ratio (WHR)
7676
#'
7777
#' @description This function calculates the Waist-to-Height Ratio (WHR) by dividing the waist circumference by the height of the respondent.
7878
#'

R/diabetes.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#' @title Determine Inclusive Diabetes Status
1+
#' @title Diabetes derived variable
22
#'
3-
#' @description This function evaluates inclusive diabetes status based on three factors: `diab_m`, `CCC_51`, and `diab_drug2`.
3+
#' @description This function evaluates diabetes status based on three factors: `diab_m`, `CCC_51`, and `diab_drug2`.
44
#'
55
#' @param diab_m An integer indicating whether the respondent has diabetes based on HbA1c level. 1 for "Yes", 2 for "No".
66
#' @param CCC_51 An integer indicating whether the respondent self-reported diabetes. 1 for "Yes", 2 for "No".

R/diet.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#' @title Calculate daily fruit and vegetable consumption in a year for respondent in CHMS cycles 1-2.
1+
#' @title Daily fruit and vegetable consumption in a year - cycles 1-2
22
#'
33
#' @description This function calculates the daily fruit and vegetable consumption in a year for respondent in the Canadian Health Measures
44
#' Survey (CHMS) cycles 1-2. It takes seven parameters, each representing the number of times per year a specific fruit or vegetable item
@@ -53,7 +53,7 @@ find_totalFV_cycles1and2 <- function(WSDD14Y, GFVD17Y, GFVD18Y, GFVD19Y, GFVD20Y
5353
return(totalFV)
5454
}
5555

56-
#' @title Calculate daily fruit and vegetable consumption in a year for respondents in CHMS cycles 3-6.
56+
#' @title Daily fruit and vegetable consumption in a year - cycles 3-6
5757
#'
5858
#' @description This function calculates the daily fruit and vegetable consumption in a year for respondents in the Canadian Health Measures
5959
#' Survey (CHMS) cycles 3-6. It takes eleven parameters, each representing the number of times per year a specific fruit or
@@ -115,7 +115,7 @@ find_totalFV_cycles3to6 <- function(WSDD34Y, WSDD35Y, GFVD17AY, GFVD17BY, GFVD17
115115
return(totalFV)
116116
}
117117

118-
#' @title Diet Categorization
118+
#' @title Categorical diet indicator
119119
#'
120120
#' @description This function categorizes individuals' diet quality based on their total fruit and vegetable consumption.
121121
#'

R/exercise.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#' @title Calculate the average minutes of exercise per day for week-long accelerometer data.
1+
#' @title Average minutes of exercise per day for week-long accelerometer data
22
#'
33
#' @description This function calculates the average minutes of exercise per day across a week of accelerometer data. It takes seven
44
#' parameters, each representing the minutes of exercise on a specific day (Day 1 to Day 7) of accelerometer measurement.
@@ -43,7 +43,7 @@ find_week_accelerometer_average <- function(AMMDMVA1, AMMDMVA2, AMMDMVA3, AMMDMV
4343
return(MVPA_min)
4444
}
4545

46-
#' @title Convert minutes per day to minutes per week.
46+
#' @title Minutes per week from minutes per day
4747
#'
4848
#' @description This function takes the average minutes of exercise per day across a week of accelerometer use as an input (`MVPA_min`) and
4949
#' calculates the equivalent minutes of exercise per one week of accelerometer use. The result is returned as a numeric value.
@@ -70,9 +70,9 @@ minperday_to_minperweek <- function(MVPA_min) {
7070
return(minperweek)
7171
}
7272

73-
#' Categorize Weekly Physical Activity
73+
#' @title Categorical weekly physical activity indicator
7474
#'
75-
#' This function categorizes individuals' weekly physical activity levels based on a threshold value.
75+
#' @description This function categorizes individuals' weekly physical activity levels based on a threshold value.
7676
#'
7777
#' @param minperweek Numeric value representing an individual's minutes of moderate-to-vigorous
7878
#' physical activity (MVPA) per week.

R/family-history.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#' @title Determine cardiovascular disease (CVD) personal history
1+
#' @title Cardiovascular disease (CVD) personal history
22
#'
33
#' @description This function determines a respondent's cardiovascular disease (CVD) personal history based on the presence or absence
44
#' of specific conditions related to heart disease, heart attack, and stroke.
@@ -35,7 +35,7 @@ determine_CVD_Personal_History <- function(CCC_61, CCC_63, CCC_81) {
3535
return(cardiov)
3636
}
3737

38-
#' @title Determine Cardiovascular Disease (CVD) Family History
38+
#' @title Cardiovascular Disease (CVD) family history
3939
#'
4040
#' @description This function evaluates a respondent's family history of cardiovascular disease (CVD), based on data about diagnoses of heart disease and stroke in immediate family members and the ages at which these diagnoses occurred. It identifies premature CVD if any diagnosis occurred before age 60.
4141
#'

R/income.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#' @title Calculate adjusted total household income based on weighted household size.
1+
#' @title Adjusted total household income
22
#'
33
#' @description This function calculates the adjusted total household income based on the respondent's income amount
44
#' and actual household size, taking into account the weighted household size.
@@ -58,9 +58,9 @@ calculate_Hhld_Income <- function(THI_01, DHHDHSZ) {
5858
return(adj_hh_inc)
5959
}
6060

61-
#' Categorize Household Income
61+
#' @title Categorical adjusted household income
6262
#'
63-
#' This function categorizes individuals' household income based on specified income ranges.
63+
#' @description This function categorizes individuals' adjusted household income based on specified income ranges.
6464
#'
6565
#' @param adj_hh_inc Numeric value representing the adjusted household income.
6666
#'
@@ -103,9 +103,9 @@ categorize_income <- function(adj_hh_inc) {
103103
return(incq)
104104
}
105105

106-
#' Check If in Lowest Income Quintile
106+
#' @title Lowest income quintile indicator
107107
#'
108-
#' This function checks if an individual's income category corresponds to the lowest income quintile.
108+
#' @description This function checks if an individual's income category corresponds to the lowest income quintile.
109109
#'
110110
#' @param incq Categorical value indicating the income category as defined by the categorize_income function.
111111
#'

R/kidney.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#' @title Calculate the estimated glomerular filtration rate (GFR) based on serum creatine
1+
#' @title Estimated glomerular filtration rate (GFR)
22
#'
33
#' @description This function calculates the estimated glomerular filtration rate (GFR) according to Finlay's formula,
44
#' where serum creatine is in mg/dL. The calculation takes into account the respondent's ethnicity, sex, and age.
@@ -65,9 +65,9 @@ calculate_GFR <- function(LAB_BCRE, PGDCGT, CLC_SEX, CLC_AGE) {
6565
return(GFR)
6666
}
6767

68-
#' Categorize Glomerular Filtration Rate (GFR) to Chronic Kidney Disease (CKD) Stage
68+
#' @title Chronic kidney disease (CKD) derived variable
6969
#'
70-
#' This function categorizes individuals' glomerular filtration rate (GFR) into stages of Chronic Kidney Disease (CKD).
70+
#' @description This function categorizes individuals' glomerular filtration rate (GFR) into stages of Chronic Kidney Disease (CKD).
7171
#'
7272
#' @param GFR Numeric value representing the glomerular filtration rate.
7373
#'

0 commit comments

Comments
 (0)