Skip to content

Conversation

@jeffreyad
Copy link
Collaborator

@jeffreyad jeffreyad commented Nov 14, 2025

Pull Request

DESCRIPTION GOES HERE

Before you submit your pull request, take a look at the following checklist. Many thanks for your contribution!

  • Title: Place Closes #<insert_issue_number> at the beginning of your PR title. Use the Edit button in the top-right if you need to update.
  • Linked Issue: Ensure the related issue is linked in the "Development Section" on the right-hand side.
  • First Contribution: If this is your first contribution, add yourself to the DESCRIPTION file.
  • Impact on Examples: If your updates impact any examples, review locally for warnings or errors in the impacted example pages.
  • Merge Conflicts: Developers should address any merge conflicts and merge upon successful review.
  • New Packages: If new packages were used, ensure they are included in the DESCRIPTION file's Imports section.
  • Updated Examples: If you added or updated an example, ensure it runs on the latest CRAN release versions of all packages used.
  • Testing Instructions: Provide instructions on how to test the code if necessary.

Copilot AI and others added 8 commits November 13, 2025 23:19
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>
Copy link
Contributor

Copilot AI left a 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.qmd to new cards/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
```
Copy link

Copilot AI Nov 14, 2025

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.

Suggested change
```

See also

For a traditional approach using {rtables} and {tern} without ARDs, see the Demographic Table example.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

@ddsjoberg ddsjoberg left a 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
Copy link
Collaborator

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
Copy link
Collaborator

@ddsjoberg ddsjoberg Nov 19, 2025

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.
Copy link
Collaborator

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

@jeffreyad
Copy link
Collaborator Author

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!

Thanks @ddsjoberg! I think our idea was to get more visibility to ARD and {cards}. Perhaps we could leave the TLG section mostly intact and add an ARD section after it to expand or provide more details. Any thoughts @rossfarrugia and @bms63?

@bms63
Copy link
Collaborator

bms63 commented Nov 19, 2025

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!

Thanks @ddsjoberg! I think our idea was to get more visibility to ARD and {cards}. Perhaps we could leave the TLG section mostly intact and add an ARD section after it to expand or provide more details. Any thoughts @rossfarrugia and @bms63?

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??

@ddsjoberg
Copy link
Collaborator

ddsjoberg commented Nov 19, 2025

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)?

@rossfarrugia
Copy link
Contributor

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.

jeffreyad and others added 3 commits December 4, 2025 11:03
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Separate out cards/ARD example into its own category

5 participants