-
-
Notifications
You must be signed in to change notification settings - Fork 3
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 as_card()
function to convert to class 'card'
#292
Conversation
Unit Tests Summary 1 files 105 suites 29s ⏱️ Results for commit cb224ce. ♻️ This comment has been updated with latest results. |
Unit Test Performance Difference
Additional test case details
Results for commit 5d0f96f ♻️ This comment has been updated with latest results. |
Code Coverage Summary
Diff against main
Results for commit: cb224ce Minimum allowed coverage is ♻️ This comment has been updated with latest results |
Ahhh, thank you for adding this!! One thing I encountered while prepping the first CSR was that sometimes our The issue occurs when we stack one of these empty tibble on top of a card data frame, we lose the I was thinking we should also add the card class to these empty tibbles. What do you think? For example, # return empty tibble if no variables selected -------------------------------
if (is_empty(variables)) {
return(dplyr::tibble() |> as_card())
} BUT this may cause issues in the card print method (i haven''t check though). |
Good call! I can't see any issues with the print method, but I think it makes sense to return an empty ARD where we can. I've added the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great addition! Thank you!!!
What changes are proposed in this pull request?
as_card()
function to convert data frames to ARDs of class 'card'. (Add function to coerce data frame to classcard
#283)Closes #283 and #287
Pre-review Checklist (if item does not apply, mark is as complete)
usethis::pr_merge_main()
devtools::test_coverage()
Reviewer Checklist (if item does not apply, mark is as complete)
pkgdown::build_site()
. Check the R console for errors, and review the rendered website.devtools::test_coverage()
When the branch is ready to be merged:
NEWS.md
with the changes from this pull request under the heading "# cards (development version)
". If there is an issue associated with the pull request, reference it in parentheses at the end update (seeNEWS.md
for examples).