Skip to content

Commit

Permalink
better error in edc_data_warn
Browse files Browse the repository at this point in the history
when SUBJID is not found
  • Loading branch information
DanChaltiel committed Oct 3, 2024
1 parent 0cc34e6 commit c2262f9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions R/sanity_checks.R
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,10 @@ edc_data_condition = function(.data, message, issue_n, max_subjid,
}

if(!is.null(col_subjid)){
if(!tolower(col_subjid) %in% tolower(names(.data))){
cli_abort("Could not find column {col_subjid} in the input dataset.",
class="edc_data_condition_subjid_error", call=parent.frame())
}
subj = .data %>% pull(any_of2(col_subjid)) %>% unique() %>% sort()
n_subj = length(subj)
subj = paste0("#", subj) %>%
Expand Down

0 comments on commit c2262f9

Please sign in to comment.