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

Improve messaging for print_ard_conditions() #348

Closed
ddsjoberg opened this issue Oct 16, 2024 · 0 comments · Fixed by #354
Closed

Improve messaging for print_ard_conditions() #348

ddsjoberg opened this issue Oct 16, 2024 · 0 comments · Fixed by #354

Comments

@ddsjoberg
Copy link
Collaborator

ard <- cards::ADSL |> 
  cards::ard_continuous(
    variable = AGEGR1,
    statistic = ~list(kurtosis = \(x) e1071::kurtosis(x))
  )

# do we really need to print 'returned during `print_ard_conditions()`'? Seems unnecessary because that is not where the error originated.
library(cards)
print_ard_conditions(ard)
#> The following errors were returned during `print_ard_conditions()`:
#> ✖ For variable `AGEGR1` and "kurtosis" statistic: non-numeric argument to
#>   binary operator
#> The following warnings were returned during `print_ard_conditions()`:
#> ! For variable `AGEGR1` and "kurtosis" statistic: argument is not numeric or
#>   logical: returning NA

# when the function is namespaced, we get extra prints of `::` `cards`
cards::print_ard_conditions(ard)
#> The following errors were returned during `::()`, `cards()`, and
#> `print_ard_conditions()`:
#> ✖ For variable `AGEGR1` and "kurtosis" statistic: non-numeric argument to
#>   binary operator
#> The following warnings were returned during `::()`, `cards()`, and
#> `print_ard_conditions()`:
#> ! For variable `AGEGR1` and "kurtosis" statistic: argument is not numeric or
#>   logical: returning NA

Created on 2024-10-16 with reprex v2.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant