Skip to content

Commit

Permalink
#1826 Fix some formatting issues for CI/CD checks
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreyad committed Apr 27, 2023
1 parent f88161b commit 3fa73ae
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions R/compute_kidney.R
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
#' )
#'
#' library(tibble)
#' library(dplyr)
#'
#' base <- tribble(
#' ~STUDYID, ~USUBJID, ~AGE, ~SEX, ~RACE, ~WTBL, ~CREATBL, ~CREATBLU,
Expand All @@ -101,9 +102,18 @@
#'
#' base_egfr <- base %>%
#' mutate(
#' CRCL_CG = compute_egfr(creat = CREATBL, age = AGE, wt = WTBL, sex = SEX, method = "CRCL"),
#' EGFR_EPI = compute_egfr(creat = CREATBL, age = AGE, wt = WTBL, sex = SEX, method = "CKD-EPI"),
#' EGFR_MDRD = compute_egfr(creat = CREATBL, age = AGE, wt = WTBL, sex = SEX, race = RACE, method = "MDRD"),
#' CRCL_CG = compute_egfr(
#' creat = CREATBL, age = AGE, wt = WTBL, sex = SEX,
#' method = "CRCL"
#' ),
#' EGFR_EPI = compute_egfr(
#' creat = CREATBL, age = AGE, wt = WTBL, sex = SEX,
#' method = "CKD-EPI"
#' ),
#' EGFR_MDRD = compute_egfr(
#' creat = CREATBL, age = AGE, wt = WTBL, sex = SEX,
#' race = RACE, method = "MDRD"
#' ),
#' )
compute_egfr <- function(creat, age, wt, sex, race, method) {
assert_numeric_vector(creat)
Expand All @@ -122,7 +132,8 @@ compute_egfr <- function(creat, age, wt, sex, race, method) {
assert_character_vector(race)

egfr <- case_when(
race == "BLACK OR AFRICAN AMERICAN" & sex == "F" ~ 175 * (scr^-1.154) * (age^-0.203) * 0.742 * 1.212,
race == "BLACK OR AFRICAN AMERICAN" & sex == "F" ~ 175 * (scr^-1.154) *
(age^-0.203) * 0.742 * 1.212,
race == "BLACK OR AFRICAN AMERICAN" ~ 175 * (scr^-1.154) * (age^-0.203) * 1.212,
sex == "F" ~ 175 * (scr^-1.154) * (age^-0.203) * 0.742,
TRUE ~ 175 * (scr^-1.154) * (age^-0.203)
Expand Down

0 comments on commit 3fa73ae

Please sign in to comment.