Skip to content

Commit

Permalink
Add empty ARD lines to ard_complex
Browse files Browse the repository at this point in the history
  • Loading branch information
edelarua committed Aug 20, 2024
1 parent 451ec07 commit cb224ce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions R/ard_complex.R
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ ard_complex.data.frame <- function(data,
check_not_missing(variables)
check_not_missing(statistic)

# return empty ARD if no variables selected ----------------------------------
if (is_empty(variables)) {
return(dplyr::tibble() |> as_card())
}

# process inputs -------------------------------------------------------------
process_selectors(data, variables = {{ variables }})
process_formula_selectors(data[variables], statistic = statistic, allow_empty = FALSE)
Expand Down
2 changes: 1 addition & 1 deletion R/ard_missing.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ ard_missing.data.frame <- function(data,
# process variable inputs ----------------------------------------------------
process_selectors(data, variables = {{ variables }})

# return empty tibble if no variables selected -------------------------------
# return empty ARD if no variables selected ----------------------------------
if (is_empty(variables)) {
return(dplyr::tibble() |> as_card())
}
Expand Down

0 comments on commit cb224ce

Please sign in to comment.