Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix as cran #177

Merged
merged 3 commits into from
Sep 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ Suggests:
scda.2021 (>= 0.1.3),
teal.data (>= 0.1.1),
testthat (>= 2.0)
VignetteBuilder:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#146 (comment) --as-cran complains there are no vignettes but vignettebuilder is specified

knitr
Remotes:
insightsengineering/osprey@*release,
insightsengineering/scda.2021@*release,
Expand Down
5 changes: 3 additions & 2 deletions R/tm_g_ae_oview.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
#' library(scda)
#' library(nestcolor)
#'
#' ADSL <- synthetic_cdisc_data("latest")$adsl
#' ADAE <- synthetic_cdisc_data("latest")$adae
#' latest_data <- synthetic_cdisc_data("latest")
#' ADSL <- latest_data$adsl
#' ADAE <- latest_data$adae
#'
#' # Add additional dummy causality flags.
#' add_event_flags <- function(dat) {
Expand Down
28 changes: 15 additions & 13 deletions R/tm_g_heat_bygrade.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@
#' library(scda)
#' library(dplyr)
#' library(nestcolor)
#' ADSL <- synthetic_cdisc_data("latest")$adsl %>% slice(1:30)
#' ADEX <- synthetic_cdisc_data("latest")$adex %>% filter(USUBJID %in% ADSL$USUBJID)
#' ADAE <- synthetic_cdisc_data("latest")$adae %>% filter(USUBJID %in% ADSL$USUBJID)
#' ADCM <- synthetic_cdisc_data("latest")$adcm %>% filter(USUBJID %in% ADSL$USUBJID)
#' latest_data <- synthetic_cdisc_data("latest")
#' ADSL <- latest_data$adsl %>% slice(1:30)
#' ADEX <- latest_data$adex %>% filter(USUBJID %in% ADSL$USUBJID)
#' ADAE <- latest_data$adae %>% filter(USUBJID %in% ADSL$USUBJID)
#' ADCM <- latest_data$adcm %>% filter(USUBJID %in% ADSL$USUBJID)
#'
#' # This preprocess is only to force legacy standard on ADCM
#' ADCM <- ADCM %>%
Expand Down Expand Up @@ -76,10 +77,11 @@
#' cdisc_dataset("ADAE", ADAE),
#' cdisc_dataset("ADCM", ADCM, keys = c("STUDYID", "USUBJID", "ASTDTM", "CMSEQ", "CMDECOD")),
#' code = "
#' ADSL <- synthetic_cdisc_data(\"latest\")$adsl %>% slice(1:30)
#' ADEX <- synthetic_cdisc_data(\"latest\")$adex %>% filter(USUBJID %in% ADSL$USUBJID)
#' ADAE <- synthetic_cdisc_data(\"latest\")$adae %>% filter(USUBJID %in% ADSL$USUBJID)
#' ADCM <- synthetic_cdisc_data(\"latest\")$adcm %>% filter(USUBJID %in% ADSL$USUBJID)
#' latest_data <- synthetic_cdisc_data('latest')
#' ADSL <- latest_data$adsl %>% slice(1:30)
#' ADEX <- latest_data$adex %>% filter(USUBJID %in% ADSL$USUBJID)
#' ADAE <- latest_data$adae %>% filter(USUBJID %in% ADSL$USUBJID)
#' ADCM <- latest_data$adcm %>% filter(USUBJID %in% ADSL$USUBJID)
#' ADCM <- ADCM %>% select(-starts_with(\"ATC\")) %>% unique()
#' ADEX <- ADEX %>%
#' filter(PARCAT1 == 'INDIVIDUAL') %>%
Expand Down Expand Up @@ -324,7 +326,7 @@ srv_g_heatmap_bygrade <- function(id,
observeEvent(input$plot_cm, {
ADCM <- datasets$get_data(cm_dataname, filtered = TRUE) # nolint
ADCM_label <- formatters::var_labels(datasets$get_data(cm_dataname, filtered = FALSE), fill = FALSE) # nolint
formatters::var_labels(ADCM) <- ADCM_label
formatters::var_labels(ADCM) <- ADCM_label # nolint
choices <- levels(ADCM[[input$conmed_var]])

updateSelectInput(
Expand All @@ -347,11 +349,11 @@ srv_g_heatmap_bygrade <- function(id,
ADAE <- datasets$get_data(ae_dataname, filtered = TRUE) # nolint

# assign labels back to the data
formatters::var_labels(ADSL) <-
formatters::var_labels(ADSL) <- # nolint
formatters::var_labels(datasets$get_data(sl_dataname, filtered = FALSE), fill = FALSE)
formatters::var_labels(ADEX) <-
formatters::var_labels(ADEX) <- # nolint
formatters::var_labels(datasets$get_data(ex_dataname, filtered = FALSE), fill = FALSE)
formatters::var_labels(ADAE) <-
formatters::var_labels(ADAE) <- # nolint
formatters::var_labels(datasets$get_data(ae_dataname, filtered = FALSE), fill = FALSE)

validate(need(nrow(ADSL) > 0, "Please select at least one subject"))
Expand Down Expand Up @@ -379,7 +381,7 @@ srv_g_heatmap_bygrade <- function(id,
if (input$plot_cm) {
ADCM <- datasets$get_data(cm_dataname, filtered = TRUE) # nolint
ADCM_label <- formatters::var_labels(datasets$get_data(cm_dataname, filtered = FALSE), fill = FALSE) # nolint
formatters::var_labels(ADCM) <- ADCM_label
formatters::var_labels(ADCM) <- ADCM_label # nolint
validate(
need(
input$conmed_var %in% names(ADCM),
Expand Down
22 changes: 12 additions & 10 deletions R/tm_g_patient_profile.R
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,15 @@
#' library(scda)
#' library(nestcolor)
#'
#' ADSL <- synthetic_cdisc_data("latest")$adsl
#' ADAE <- synthetic_cdisc_data("latest")$adae %>%
#' latest_data <- synthetic_cdisc_data("latest")
#'
#' ADSL <- latest_data$adsl
#' ADAE <- latest_data$adae %>%
#' mutate(
#' ASTDT = as.Date(ASTDTM),
#' AENDT = as.Date(AENDTM)
#' )
#' ADCM <- synthetic_cdisc_data("latest")$adcm %>%
#' ADCM <- latest_data$adcm %>%
#' mutate(
#' ASTDT = as.Date(ASTDTM),
#' AENDT = as.Date(AENDTM)
Expand All @@ -101,14 +103,14 @@
#' select(-starts_with("ATC")) %>%
#' unique()
#'
#' ADRS <- synthetic_cdisc_data("latest")$adrs %>%
#' ADRS <- latest_data$adrs %>%
#' mutate(ADT = as.Date(ADTM))
#' ADEX <- synthetic_cdisc_data("latest")$adex %>%
#' ADEX <- latest_data$adex %>%
#' mutate(
#' ASTDT = as.Date(ASTDTM),
#' AENDT = as.Date(AENDTM)
#' )
#' ADLB <- synthetic_cdisc_data("latest")$adlb %>%
#' ADLB <- latest_data$adlb %>%
#' mutate(
#' ADT = as.Date(ADTM),
#' LBSTRESN = as.numeric(LBSTRESC)
Expand Down Expand Up @@ -145,7 +147,7 @@
#' mutate(ASTDT = as.Date(ASTDTM),
#' AENDT = as.Date(AENDTM))"
#' ),
#' check = TRUE
#' check = FALSE # set FALSE here to keep run time of example short, should be set to TRUE
#' ),
#' modules = modules(
#' tm_g_patient_profile(
Expand Down Expand Up @@ -564,7 +566,7 @@ srv_g_patient_profile <- function(id,
ADAE <- NULL # nolint
} else {
ADAE <- datasets$get_data(ae_dataname, filtered = TRUE) # nolint
formatters::var_labels(ADAE) <- formatters::var_labels(
formatters::var_labels(ADAE) <- formatters::var_labels( # nolint
datasets$get_data(ae_dataname, filtered = FALSE),
fill = FALSE
)
Expand Down Expand Up @@ -654,7 +656,7 @@ srv_g_patient_profile <- function(id,
expression = bquote({
ADSL <- ADSL %>% # nolint
group_by(.data$USUBJID)
ADSL$max_date <- pmax(
ADSL$max_date <- pmax( # nolint
as.Date(ADSL$LSTALVDT),
as.Date(ADSL$DTHDT),
na.rm = TRUE
Expand Down Expand Up @@ -745,7 +747,7 @@ srv_g_patient_profile <- function(id,
as.character(eval(parse(text = .(sl_start_date), keep.source = FALSE))), 1, 10
)))) %>%
select(c(.(adae_vars), ASTDY, AENDY))
formatters::var_labels(ADAE)[.(ae_line_col_var)] <-
formatters::var_labels(ADAE)[.(ae_line_col_var)] <- # nolint
formatters::var_labels(ADAE, fill = FALSE)[.(ae_line_col_var)]
})
)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# teal.osprey

The teal.osprey package provides community contributed `teal` modules of the analysis functions from the [osprey](https://insightsengineering.github.io/osprey) R package.
The teal.osprey package provides community contributed `teal` modules of the analysis functions from the [osprey](https://insightsengineering.github.io/osprey/) R package.
This enables `teal` app developers to easily create applications making use of the `osprey` analysis functions.

## Installation
Expand All @@ -15,7 +15,7 @@ remotes::install_github("insightsengineering/teal.osprey@*release")

A stable release of all `NEST` packages from June 2022 is also available [here](https://github.com/insightsengineering/depository#readme).

In order to run many of the examples you will also need to install the [`scda`](https://insightsengineering.github.io/scda) package.
In order to run many of the examples you will also need to install the [`scda`](https://insightsengineering.github.io/scda/) package.

## Stargazers and Forkers

Expand Down
5 changes: 3 additions & 2 deletions man/tm_g_ae_oview.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 10 additions & 8 deletions man/tm_g_heat_bygrade.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 9 additions & 7 deletions man/tm_g_patient_profile.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.