{"id":18733497,"url":"https://github.com/insightsengineering/cardx","last_synced_at":"2026-02-05T11:08:37.484Z","repository":{"id":218628988,"uuid":"743525134","full_name":"insightsengineering/cardx","owner":"insightsengineering","description":"R Package to Supplement ARD Functions Found in {cards}","archived":false,"fork":false,"pushed_at":"2026-02-04T16:15:29.000Z","size":35500,"stargazers_count":20,"open_issues_count":19,"forks_count":6,"subscribers_count":5,"default_branch":"main","last_synced_at":"2026-02-05T03:39:10.184Z","etag":null,"topics":["r"],"latest_commit_sha":null,"homepage":"https://insightsengineering.github.io/cardx/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/insightsengineering.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"custom":["https://pharmaverse.org"]}},"created_at":"2024-01-15T12:27:13.000Z","updated_at":"2026-02-04T16:05:37.000Z","dependencies_parsed_at":"2024-04-14T23:32:56.422Z","dependency_job_id":"8f22f39a-9f5b-458d-b77a-3e8f6e88bdc3","html_url":"https://github.com/insightsengineering/cardx","commit_stats":null,"previous_names":["insightsengineering/cardx"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/insightsengineering/cardx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insightsengineering%2Fcardx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insightsengineering%2Fcardx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insightsengineering%2Fcardx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insightsengineering%2Fcardx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/insightsengineering","download_url":"https://codeload.github.com/insightsengineering/cardx/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insightsengineering%2Fcardx/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29120484,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T10:47:47.471Z","status":"ssl_error","status_checked_at":"2026-02-05T10:45:08.119Z","response_time":65,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["r"],"created_at":"2024-11-07T15:09:58.223Z","updated_at":"2026-02-05T11:08:37.477Z","avatar_url":"https://github.com/insightsengineering.png","language":"R","funding_links":["https://pharmaverse.org"],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\neditor_options: \n  markdown: \n    wrap: 72\n---\n\n# cardx \u003ca href=\"https://insightsengineering.github.io/cardx/\"\u003e\u003cimg src=\"man/figures/logo.png\" align=\"right\" height=\"120\" alt=\"cardx website\" /\u003e\u003c/a\u003e\n \n\u003c!-- badges: start --\u003e\n[![R-CMD-check](https://github.com/insightsengineering/cardx/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/insightsengineering/cardx/actions/workflows/R-CMD-check.yaml)\n[![Codecov test coverage](https://codecov.io/gh/insightsengineering/cardx/branch/main/graph/badge.svg)](https://app.codecov.io/gh/insightsengineering/cardx?branch=main)\n[![CRAN status](https://www.r-pkg.org/badges/version/cardx)](https://CRAN.R-project.org/package=cardx)\n[![Downloads](https://cranlogs.r-pkg.org/badges/cardx)](https://cran.r-project.org/package=cardx)\n\u003c!-- badges: end --\u003e\n\nThe **{cardx}** package is an extension of the {cards} package, providing additional functions to create Analysis Results Data Objects (ARDs) using the **R** programming language.\nThe {cardx} package exports ARD functions that uses utility functions from {cards} and statistical functions from additional packages (such as, {stats}, {mmrm}, {emmeans}, {car}, {survey}, etc.) to construct summary objects.\n\nSummary objects can be used to:\n\n-   **Generate Tables and visualizations for Regulatory Submission**\n    easily in **R**. Perfect for presenting descriptive statistics,\n    statistical analyses, regressions, etc. and more.\n\n-   **Conduct Quality Control checks on existing Tables** in R.\n    Storing both the results and test parameters supports the re-use and\n    verification of data analyses.\n\n## Installation\n\nInstall cards from CRAN with:\n\n```r\ninstall.packages(\"cardx\")\n```\n\nYou can install the development version of cards from [GitHub](https://github.com/) with:\n\n``` r\n# install.packages(\"devtools\")\ndevtools::install_github(\"insightsengineering/cardx\")\n```\n\n## Examples\n\n### Example ARD Creation\n\nExample t-test:\n\n```{r}\nlibrary(cardx)\n\ncards::ADSL |\u003e\n  # keep two treatment arms for the t-test calculation\n  dplyr::filter(ARM %in% c(\"Placebo\", \"Xanomeline High Dose\")) |\u003e\n  cardx::ard_stats_t_test(by = ARM, variable = AGE)\n```\n\nNote that the returned ARD contains the analysis results in addition to\nthe function parameters used to calculate the results allowing for\nreproducible future analyses and further customization.\n\n### Model Input\n\nSome {cardx} functions accept regression model objects as input:\n\n```{r, eval=FALSE}\nlm(AGE ~ ARM, data = cards::ADSL) |\u003e\n  ard_aod_wald_test()\n```\n\nNote that the [Analysis Results Standard](https://www.cdisc.org/standards/foundational/analysis-results-standard) should begin with a data set rather than a model object.\nTo accomplish this we include model construction helpers.\n\n```{r}\nconstruct_model(\n  data = cards::ADSL,\n  formula = reformulate2(\"ARM\", response = \"AGE\"),\n  method = \"lm\"\n) |\u003e\n  ard_aod_wald_test()\n```\n\n## Additional Resources\n\n-   The best resources are the help documents accompanying each {cardx} function.\n-   Supporting documentation for both companion packages [{cards}](https://insightsengineering.github.io/cards/) and {[gtsummary](https://www.danieldsjoberg.com/gtsummary/index.html)} will be useful for understanding the ARD workflow and capabilities.\n\n## {cardx} + {renv}\n\nThe {cardx} package exports functions to create ARDs based on various statistical methods; methods that are primarily implemented in other packages.\n{cardx} does not take a hard dependency on these packages, meaning that these packages are not typically installed when {cardx} is installed from CRAN.\nAs a result, {renv} will not record these packages in its `lock.file` unless there is a direct reference to the underlying statistical package in your code. \nFor example, if you pass a regression model to `ard_emmeans_contrast()`, there is no direct reference to the {emmeans} package in your script and {renv} will not record the package.\n\nOne can circumvent this issue by including some kind of reference to the package in your code.\nBelow are are couple of common ways to do so.\n\n```r\nlibrary(emmeans)\n```\n\nAttaching a package with `library()` is great for its simplicity, but you may not want to attach a package if it's not necessary.\n\n```r\ninvisible(emmeans::emmeans)\n```\n\nYou can invisibly print a function from the package.\nPrinting a function does not have an effect on your environment (which is great), but it is somewhat more difficult to read.\n(_This is my preferred method._)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finsightsengineering%2Fcardx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finsightsengineering%2Fcardx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finsightsengineering%2Fcardx/lists"}