-
Notifications
You must be signed in to change notification settings - Fork 17
Closes #104 separate out cards #116
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: jeffreyad <112705781+jeffreyad@users.noreply.github.com>
Co-authored-by: jeffreyad <112705781+jeffreyad@users.noreply.github.com>
…ation Co-authored-by: jeffreyad <112705781+jeffreyad@users.noreply.github.com>
…flicts Co-authored-by: jeffreyad <112705781+jeffreyad@users.noreply.github.com>
Co-authored-by: jeffreyad <112705781+jeffreyad@users.noreply.github.com>
Separate CARDs section from TLG section
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.
Pull Request Overview
This PR refactors the demographic table documentation by separating the cards/gtsummary-based approach into a dedicated section, making the content more modular and easier to navigate. The tlg/demographic.qmd now focuses exclusively on the rtables/tern approach, while cards-based examples are moved to a new cards/ section.
- Moved cards/gtsummary demographic table examples from
tlg/demographic.qmdto newcards/cards_demographic.qmd - Added comprehensive introduction explaining ARDs and the {cards} package in the new file
- Created cross-reference from tlg section to new cards section
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tlg/demographic.qmd | Removed cards/gtsummary content; simplified introduction; added "See also" section linking to new cards example |
| cards/index.qmd | New index page for the cards section |
| cards/cards_demographic.qmd | New demographic table example using cards/gtsummary approach; includes detailed introduction about ARDs and the cards package |
| cards/cards_demographic.R | Auto-generated R script from the cards_demographic.qmd file |
| _quarto.yml | Added cards section to website navigation structure |
| inst/WORDLIST | Added "cards" to the spell-check wordlist |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # extract ARD from table object | ||
| gather_ard(tbl)[[1]] |> select(-gts_column) # removing column so ARD fits on page | ||
| ``` |
Copilot
AI
Nov 14, 2025
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.
[nitpick] Consider adding a "See also" section at the end of this file to provide a reciprocal link back to the traditional approach in the tlg section. For example:
## See also
For a traditional approach using `{rtables}` and `{tern}` without ARDs, see the [Demographic Table example](../tlg/demographic.qmd).This would improve navigation and help users discover both approaches.
| ``` |
See also
For a traditional approach using {rtables} and {tern} without ARDs, see the Demographic Table example.
ddsjoberg
left a comment
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.
I think we could discuss one point here: there is a separation of ARD and TLG, when they are inherently connected. If we want two separate sections, I don't think we can call one TLG, as the ARD section also contains TLGs and browsers of the site will likely not realize this? If we keep them separate, then more clear naming could be ARD-based TLGs and non-ARD-based TLGs. As it is currently written, if I went to the TLG section, I wouldn't find any reference to gtsummary, which could be confusing.
Thanks for requesting my comment!
| - auto: sdtm | ||
| - auto: adam | ||
| - auto: tlg | ||
| - auto: cards |
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.
Perhaps we should name the folder ARD instead of the package name?
| tbl <- adsl |> tbl_summary(by = ACTARM, include = c(AGE, AGEGR1, SEX, RACE)) | ||
| # extract ARD from table object | ||
| gather_ard(tbl)[[1]] |> select(-gts_column) # removing column so ARD fits on page |
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.
I had added [[1]] |> select(-gts_column) because the ARD print was running into multiple chunks. I think a better solution would be to increase the width of the print for this chunk. You can add this chunk just above the gtsummary-ard.
```{r}
#| include: false
options(width=120)
```And we could reset after back to the default (which I am not sure what it is in quarto websites, but I think it's 90 in quarto slides...we could print getOption("width") to get the answer)
| In the examples below, we illustrate two general approaches for creating a demographics table. | ||
| The first utilizes Analysis Results Datasets---part of the emerging [CDISC Analysis Results Standard](https://www.cdisc.org/standards/foundational/analysis-results-standard). | ||
| The second is the classic method of creating summary tables directly from a data set. | ||
| In the example below, we illustrate creating summary tables directly from a data set. |
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.
Do you want to also include the gtsummary solution here too?
tbl_summary(
data = pharmaverseadam::adsl,
by = ACTARM,
include = c(AGE, AGEGR1, SEX, RACE),
type = AGE ~ "continuous2",
statistic = AGE ~ c("{mean} ({sd})", "{median} ({p25}, {p75})", "{min}, {max}")
) |>
bold_labels() |>
remove_footnote_header() # remove default footnote
Thanks @ddsjoberg! I think our idea was to get more visibility to ARD and |
I think an ARD section afterwards would be helpful to dive in the details more. Also is there another ARD package kicking around in the pverse?? |
|
Maybe the section could be named "ARD+TLG"? With the current naming, I think it may be odd to click into the TLG section and see nothing about gtsummary (or are we planning on adding vanilla gtsummary solutions there as well, and cards+gtsummary into the ARD+TLG section)? |
|
Sorry all I'm late to the party here with my input... I like "ARD + TLG" for the new section title, and then rename the old to "TLG Only". Then for any user looking for both they'll go straight to our gtsummary/cards examples. |
Co-authored-by: Daniel Sjoberg <danield.sjoberg@gmail.com>
Co-authored-by: Daniel Sjoberg <danield.sjoberg@gmail.com>
Co-authored-by: Daniel Sjoberg <danield.sjoberg@gmail.com>
Pull Request
DESCRIPTION GOES HERE
Before you submit your pull request, take a look at the following checklist. Many thanks for your contribution!
Closes #<insert_issue_number>at the beginning of your PR title. Use the Edit button in the top-right if you need to update.DESCRIPTIONfile.DESCRIPTIONfile'sImportssection.