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

Add assert checking and notes section in Roxygen #13

Merged
merged 4 commits into from
Feb 28, 2024
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: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Authors@R: c(
person("Kai", "Gu", , "gukai1212@163.com", role = c("aut", "cre", "cph"))
)
Maintainer: Kai Gu <gukai1212@163.com>
Description: Provides common statistical analysis for oversighting process in
Description: Provides common statistical analysis for oversight process in the
clinical trials of biotech, makes the outputs can be compared with SAS results.
License: GPL (>= 3)
Encoding: UTF-8
Expand Down
21 changes: 21 additions & 0 deletions R/onco_resp.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@
#' After executing the previous steps, select the best one using the order 'CR>PR>SD>PD>NE'
#' for each subject. If the BOR is not unique, the first one (based on ADT) is selected.
#'
#' @note
#' - The `ref_start_window` refers to assessment date (ADT) minus `ref_date`. For
#' example, `ref_start_window = 28` that means ADT minus TRTSDT should be equal to
#' or greater than 28 days. And this argument is only used in non-confirmatory/confirmatory
#' of SD.
#' - The `ref_interval` refers to confirmatory assessment date minus assessment date.
#' For example, `ref_interval = 28` that means subsequent CR date minus prior CR
#' should be equal to or greater than 28 days. And this argument is used in confirmatory
#' of CR/PR.
#'
#' @return
#' A data frame with a new parameter for confirmed or not confirmed best overall response.
#'
Expand Down Expand Up @@ -120,6 +130,17 @@ derive_bor <- function(data,
ref_interval = 28,
max_ne = 1,
confirm = FALSE) {
assert_class(data, "data.frame")
assert_subset(unique_id, names(data), empty.ok = FALSE)
assert_class(aval_map, "data.frame")
assert_subset(names(aval_map), c("avalc_temp", "aval_temp"))
assert_string(spec_date, null.ok = TRUE)
assert_date(data[[ref_date]])
assert_number(ref_start_window, lower = 0)
assert_number(ref_interval, lower = 0)
assert_number(max_ne, lower = 0)
assert_logical(confirm)

data <- data %>%
arrange(!!sym(unique_id), ADT)

Expand Down
14 changes: 14 additions & 0 deletions man/derive_bor.Rd

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

Loading