Skip to content

Commit f6f20aa

Browse files
committed
Add list of possible domains to documentation, add STUDYID USUBJID as required cols
1 parent 73a59b5 commit f6f20aa

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

R/prepare_domain.R

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
#' two letter domain name as well as the domain data file.
66
#'
77
#' @param domain Character. The two letter domain name of the data.
8+
#' Domain options: "DM", "LB", "MB", "VS", "RS", "DD", "RP", "SC", "MP",
9+
#' "PF", "AU", "PC", "SA", "HO", "ER", "PO"
810
#' @param data Domain data frame.
911
#' @param include_LOC Boolean. Should the location (--LOC) be included in the
1012
#' output. Default is FALSE.
@@ -67,6 +69,8 @@ prepare_domain <- function(domain, data,
6769

6870
domain <- str_to_upper(domain)
6971

72+
assert_data_frame(data, required_vars = exprs(STUDYID, USUBJID))
73+
7074
variables_include <- str_to_upper(variables_include)
7175

7276
timing_variables <- timing_variables[which(timing_variables %in% names(data))]
@@ -85,6 +89,8 @@ prepare_domain <- function(domain, data,
8589
data <- data %>%
8690
convert_blanks_to_na()
8791

92+
93+
8894
if(length(variables_include) > 0){
8995
data <- data %>%
9096
select(STUDYID, USUBJID, any_of(variables_include))

man/prepare_domain.Rd

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)