-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- fixed package level Rd file - removed unnecessary empty first line in examples as this is actually being rendered - removed `pkg::` from docs for packages in Depends - fixed example of `toggle_slider_ui` --------- Co-authored-by: 27856297+dependabot-preview[bot]@users.noreply.github.com <27856297+dependabot-preview[bot]@users.noreply.github.com> Co-authored-by: unknown <[email protected]> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
dacc6a7
commit fe05e76
Showing
18 changed files
with
272 additions
and
270 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
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 |
---|---|---|
|
@@ -50,10 +50,15 @@ | |
#' @author Balazs Toth (tothb2) [email protected] | ||
#' | ||
#' @examples | ||
#' | ||
#' # Example using ADaM structure analysis dataset. | ||
#' data <- teal_data() | ||
#' data <- within(data, { | ||
#' library(dplyr) | ||
#' library(stringr) | ||
#' | ||
#' # use non-exported function from goshawk | ||
#' h_identify_loq_values <- getFromNamespace("h_identify_loq_values", "goshawk") | ||
#' | ||
#' # original ARM value = dose value | ||
#' arm_mapping <- list( | ||
#' "A: Drug X" = "150mg QD", | ||
|
@@ -65,11 +70,11 @@ | |
#' shape_manual <- c("N" = 1, "Y" = 2, "NA" = 0) | ||
#' | ||
#' set.seed(1) | ||
#' ADSL <- goshawk::rADSL | ||
#' ADLB <- goshawk::rADLB | ||
#' ADSL <- rADSL | ||
#' ADLB <- rADLB | ||
#' var_labels <- lapply(ADLB, function(x) attributes(x)$label) | ||
#' ADLB <- ADLB %>% | ||
#' dplyr::mutate(AVISITCD = dplyr::case_when( | ||
#' mutate(AVISITCD = case_when( | ||
#' AVISIT == "SCREENING" ~ "SCR", | ||
#' AVISIT == "BASELINE" ~ "BL", | ||
#' grepl("WEEK", AVISIT) ~ | ||
|
@@ -79,48 +84,48 @@ | |
#' substr( | ||
#' AVISIT, | ||
#' start = 6, | ||
#' stop = stringr::str_locate(AVISIT, "DAY") - 1 | ||
#' stop = str_locate(AVISIT, "DAY") - 1 | ||
#' ) | ||
#' ) | ||
#' ), | ||
#' TRUE ~ NA_character_ | ||
#' )) %>% | ||
#' dplyr::mutate(AVISITCDN = dplyr::case_when( | ||
#' mutate(AVISITCDN = case_when( | ||
#' AVISITCD == "SCR" ~ -2, | ||
#' AVISITCD == "BL" ~ 0, | ||
#' grepl("W", AVISITCD) ~ as.numeric(gsub("[^0-9]*", "", AVISITCD)), | ||
#' TRUE ~ NA_real_ | ||
#' )) %>% | ||
#' # use ARMCD values to order treatment in visualization legend | ||
#' dplyr::mutate(TRTORD = ifelse(grepl("C", ARMCD), 1, | ||
#' mutate(TRTORD = ifelse(grepl("C", ARMCD), 1, | ||
#' ifelse(grepl("B", ARMCD), 2, | ||
#' ifelse(grepl("A", ARMCD), 3, NA) | ||
#' ) | ||
#' )) %>% | ||
#' dplyr::mutate(ARM = as.character(arm_mapping[match(ARM, names(arm_mapping))])) %>% | ||
#' dplyr::mutate(ARM = factor(ARM) %>% | ||
#' mutate(ARM = as.character(arm_mapping[match(ARM, names(arm_mapping))])) %>% | ||
#' mutate(ARM = factor(ARM) %>% | ||
#' reorder(TRTORD)) %>% | ||
#' dplyr::mutate( | ||
#' ANRHI = dplyr::case_when( | ||
#' mutate( | ||
#' ANRHI = case_when( | ||
#' PARAMCD == "ALT" ~ 60, | ||
#' PARAMCD == "CRP" ~ 70, | ||
#' PARAMCD == "IGA" ~ 80, | ||
#' TRUE ~ NA_real_ | ||
#' ), | ||
#' ANRLO = dplyr::case_when( | ||
#' ANRLO = case_when( | ||
#' PARAMCD == "ALT" ~ 20, | ||
#' PARAMCD == "CRP" ~ 30, | ||
#' PARAMCD == "IGA" ~ 40, | ||
#' TRUE ~ NA_real_ | ||
#' ) | ||
#' ) %>% | ||
#' dplyr::rowwise() %>% | ||
#' dplyr::group_by(PARAMCD) %>% | ||
#' dplyr::mutate(LBSTRESC = ifelse( | ||
#' rowwise() %>% | ||
#' group_by(PARAMCD) %>% | ||
#' mutate(LBSTRESC = ifelse( | ||
#' USUBJID %in% sample(USUBJID, 1, replace = TRUE), | ||
#' paste("<", round(runif(1, min = 25, max = 30))), LBSTRESC | ||
#' )) %>% | ||
#' dplyr::mutate(LBSTRESC = ifelse( | ||
#' mutate(LBSTRESC = ifelse( | ||
#' USUBJID %in% sample(USUBJID, 1, replace = TRUE), | ||
#' paste(">", round(runif(1, min = 70, max = 75))), LBSTRESC | ||
#' )) %>% | ||
|
@@ -130,19 +135,19 @@ | |
#' attr(ADLB[["ANRLO"]], "label") <- "Analysis Normal Range Lower Limit" | ||
#' | ||
#' # add LLOQ and ULOQ variables | ||
#' ADLB_LOQS <- goshawk:::h_identify_loq_values(ADLB, "LOQFL") | ||
#' ADLB <- dplyr::left_join(ADLB, ADLB_LOQS, by = "PARAM") | ||
#' ADLB_LOQS <- h_identify_loq_values(ADLB, "LOQFL") | ||
#' ADLB <- left_join(ADLB, ADLB_LOQS, by = "PARAM") | ||
#' }) | ||
#' | ||
#' datanames <- c("ADSL", "ADLB") | ||
#' datanames(data) <- datanames | ||
#' | ||
#' join_keys(data) <- default_cdisc_join_keys[datanames] | ||
#' | ||
#' app <- teal::init( | ||
#' app <- init( | ||
#' data = data, | ||
#' modules = teal::modules( | ||
#' teal.goshawk::tm_g_gh_correlationplot( | ||
#' modules = modules( | ||
#' tm_g_gh_correlationplot( | ||
#' label = "Correlation Plot", | ||
#' dataname = "ADLB", | ||
#' param_var = "PARAMCD", | ||
|
@@ -170,7 +175,7 @@ | |
#' hline_arb_color = c("red", "blue"), | ||
#' hline_vars = c("ANRHI", "ANRLO", "ULOQN", "LLOQN"), | ||
#' hline_vars_colors = c("green", "blue", "purple", "cyan"), | ||
#' hline_vars_label = c("ANRHI Label", "ANRLO Label", "ULOQN Label", "LLOQN Label"), | ||
#' hline_vars_labels = c("ANRHI Label", "ANRLO Label", "ULOQN Label", "LLOQN Label"), | ||
#' vline_vars = c("ANRHI", "ANRLO", "ULOQN", "LLOQN"), | ||
#' vline_vars_colors = c("yellow", "orange", "brown", "gold"), | ||
#' vline_vars_labels = c("ANRHI Label", "ANRLO Label", "ULOQN Label", "LLOQN Label"), | ||
|
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
Oops, something went wrong.