-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #153 from SafetyGraphics/108-add-buncreatinine-chart
108 add buncreatinine chart
- Loading branch information
Showing
18 changed files
with
274 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,6 @@ | |
^\.lintr$ | ||
^_pkgdown\.yml$ | ||
^pkgdown$ | ||
^nepExplorer\.Rcheck$ | ||
^nepExplorer.*\.tar\.gz$ | ||
^nepExplorer.*\.tgz$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -109,3 +109,6 @@ dist | |
.Rhistory | ||
.RData | ||
docs | ||
nepExplorer.Rcheck/ | ||
nepExplorer*.tar.gz | ||
nepExplorer*.tgz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Package: nepExplorer | ||
Type: Package | ||
Title: Interactive Graphic for Exploring Kidney Function Data in Clinical Trials. | ||
Title: Interactive Graphic for Exploring Kidney Function Data in Clinical Trials | ||
Version: 0.1.0 | ||
Authors@R: c( | ||
person("Preston", "Burns", email = "[email protected]", role = c("cre","aut")), | ||
|
@@ -15,7 +15,7 @@ Depends: R (>= 4.0) | |
License: MIT + file LICENSE | ||
Encoding: UTF-8 | ||
LazyData: true | ||
RoxygenNote: 7.3.1 | ||
RoxygenNote: 7.3.2 | ||
Imports: | ||
shiny, | ||
dplyr, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,71 @@ | ||
# test file from | ||
# https://raw.githubusercontent.com/RhoInc/data-library/master/data/clinical-trials/renderer-specific/adbds.csv" | ||
# The conversion factors may vary based on your specific data. | ||
# It's recommended to use the conversion units established by your | ||
# own sponsor lab conversions. | ||
|
||
adlb <- read.csv("https://raw.githubusercontent.com/RhoInc/data-library/master/data/clinical-trials/renderer-specific/adbds.csv", | ||
# Helper functions for unit conversions - shortened names | ||
# The conversion factors may vary based on your specific data. | ||
# It's recommended to use the conversion units established by your | ||
# own sponsor lab conversions. | ||
|
||
# 1 mg/dL creatinine = 88.4 µmol/L | ||
convert_creat_to_mgdl <- function(value) { | ||
value / 88.4 | ||
} | ||
# 1 mmol/L BUN = 2.8 mg/dL | ||
convert_bun_to_mgdl <- function(value) { | ||
value * 2.86 | ||
} | ||
# 1 g/L ALB = 100 mg/dL | ||
convert_alb_to_mgdl <- function(value) { | ||
value * 100 | ||
} | ||
|
||
adlb_ <- read.csv("https://raw.githubusercontent.com/RhoInc/data-library/master/data/clinical-trials/renderer-specific/adbds.csv", | ||
encoding = "UTF-8") %>% | ||
mutate(STRESN = ifelse(TEST == "Creatinine" & STRESU == "μmol/L", STRESN * .0113, STRESN), #Convert μmol/L to mg/dL | ||
STRESU = ifelse(TEST == "Creatinine" & STRESU == "μmol/L", "mg/dL", STRESU), | ||
mutate( | ||
# Use case_when for clearer conditional logic | ||
STRESN = case_when( | ||
TEST == "Creatinine" ~ convert_creat_to_mgdl(STRESN), | ||
TEST == "Blood Urea Nitrogen" ~ convert_bun_to_mgdl(STRESN), | ||
TEST == "Albumin" ~ convert_alb_to_mgdl(STRESN), | ||
TRUE ~ STRESN | ||
), | ||
STNRLO = case_when( | ||
TEST == "Creatinine" ~ convert_creat_to_mgdl(STNRLO), | ||
TEST == "Blood Urea Nitrogen" ~ convert_bun_to_mgdl(STNRLO), | ||
TEST == "Albumin" ~ convert_alb_to_mgdl(STNRLO), | ||
TRUE ~ STNRLO | ||
), | ||
STNRHI = case_when( | ||
TEST == "Creatinine" ~ convert_creat_to_mgdl(STNRHI), | ||
TEST == "Blood Urea Nitrogen" ~ convert_bun_to_mgdl(STNRHI), | ||
TEST == "Albumin" ~ convert_alb_to_mgdl(STNRHI), | ||
TRUE ~ STNRHI | ||
), | ||
STRESU = ifelse(TEST %in% c("Creatinine", "Blood Urea Nitrogen", "Albumin"), "mg/dL", | ||
ifelse(TEST == "Albumin/Creatinine", "Ratio", STRESU)), | ||
BLFL = ifelse(VISIT == "Screening", TRUE, FALSE) # add baseline column | ||
) %>% | ||
mutate(BLFL = ifelse(VISIT == "Screening", TRUE, FALSE)) %>% # add baseline column | ||
ungroup() %>% | ||
filter(!(TEST %in% c("Diastolic Blood Pressure", | ||
"Heart Rate", | ||
"Respiratory Rate", | ||
"Systolic Blood Pressure", | ||
"Temperature", ""))) | ||
|
||
# derive BUN/serum creatinine ratio | ||
adlb <- adlb_ %>% | ||
filter(TEST %in% c("Blood Urea Nitrogen", "Creatinine")) %>% | ||
select(-c("STNRLO", "STNRHI")) %>% | ||
tidyr::spread(TEST, STRESN) %>% | ||
mutate(STRESN = `Blood Urea Nitrogen` / Creatinine, | ||
TEST = "Blood Urea Nitrogen/Creatinine", | ||
STRESU = "Ratio") %>% | ||
select(-c("Blood Urea Nitrogen", "Creatinine")) %>% | ||
dplyr::bind_rows(adlb_) | ||
|
||
|
||
usethis::use_data(adlb, overwrite = TRUE) | ||
|
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Binary file removed
BIN
-576 KB
docs/Kid International 2015-87-62 acute kidney injury definition.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.