{"id":13751855,"url":"https://github.com/insightsengineering/rtables","last_synced_at":"2026-04-01T20:43:44.500Z","repository":{"id":38319429,"uuid":"110836137","full_name":"insightsengineering/rtables","owner":"insightsengineering","description":"Reporting tables with R","archived":false,"fork":false,"pushed_at":"2026-03-23T21:42:21.000Z","size":142666,"stargazers_count":252,"open_issues_count":34,"forks_count":51,"subscribers_count":17,"default_branch":"main","last_synced_at":"2026-03-24T20:00:15.758Z","etag":null,"topics":["pharmaceuticals","r","tables"],"latest_commit_sha":null,"homepage":"https://insightsengineering.github.io/rtables/","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":".github/CODEOWNERS","security":null,"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":"2017-11-15T13:22:09.000Z","updated_at":"2026-02-19T20:54:14.000Z","dependencies_parsed_at":"2022-07-11T02:00:29.563Z","dependency_job_id":"feb138aa-b58c-4d54-b9fd-08227d5d6b3b","html_url":"https://github.com/insightsengineering/rtables","commit_stats":{"total_commits":884,"total_committers":42,"mean_commits":"21.047619047619047","dds":"0.44909502262443435","last_synced_commit":"748955a91877d23023c1bb6102d9fb39326e6b62"},"previous_names":["roche/rtables"],"tags_count":56,"template":false,"template_full_name":null,"purl":"pkg:github/insightsengineering/rtables","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insightsengineering%2Frtables","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insightsengineering%2Frtables/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insightsengineering%2Frtables/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insightsengineering%2Frtables/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/insightsengineering","download_url":"https://codeload.github.com/insightsengineering/rtables/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insightsengineering%2Frtables/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31291780,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T13:12:26.723Z","status":"ssl_error","status_checked_at":"2026-04-01T13:12:25.102Z","response_time":53,"last_error":"SSL_read: 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":["pharmaceuticals","r","tables"],"created_at":"2024-08-03T09:00:55.967Z","updated_at":"2026-04-01T20:43:44.477Z","avatar_url":"https://github.com/insightsengineering.png","language":"R","funding_links":["https://pharmaverse.org"],"categories":["Ranked by starred repositories","R"],"sub_categories":[],"readme":"---\noutput: github_document\neditor_options:\n  chunk_output_type: console\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, echo = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\"\n)\nsuppressPackageStartupMessages(library(rtables))\nsuppressPackageStartupMessages(library(dplyr))\n```\n\n# rtables \u003ca href='https://github.com/insightsengineering/rtables'\u003e\u003cimg src=\"man/figures/logo.svg\" align=\"right\" height=\"200\" width=\"200\"/\u003e\u003c/a\u003e\n\n\u003c!-- start badges --\u003e\n[![Check 🛠](https://github.com/insightsengineering/rtables/actions/workflows/check.yaml/badge.svg)](https://github.com/insightsengineering/rtables/actions/workflows/check.yaml)\n[![Docs 📚](https://github.com/insightsengineering/rtables/actions/workflows/docs.yaml/badge.svg)](https://insightsengineering.github.io/rtables/)\n[![Code Coverage 📔](https://raw.githubusercontent.com/insightsengineering/rtables/_xml_coverage_reports/data/main/badge.svg)](https://raw.githubusercontent.com/insightsengineering/rtables/_xml_coverage_reports/data/main/coverage.xml)\n\n![GitHub forks](https://img.shields.io/github/forks/insightsengineering/rtables?style=social)\n![GitHub repo stars](https://img.shields.io/github/stars/insightsengineering/rtables?style=social)\n\n![GitHub commit activity](https://img.shields.io/github/commit-activity/m/insightsengineering/rtables)\n![GitHub contributors](https://img.shields.io/github/contributors/insightsengineering/rtables)\n![GitHub last commit](https://img.shields.io/github/last-commit/insightsengineering/rtables)\n![GitHub pull requests](https://img.shields.io/github/issues-pr/insightsengineering/rtables)\n![GitHub repo size](https://img.shields.io/github/repo-size/insightsengineering/rtables)\n![GitHub language count](https://img.shields.io/github/languages/count/insightsengineering/rtables)\n[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)\n[![Open Issues](https://img.shields.io/github/issues-raw/insightsengineering/rtables?color=red\\\u0026label=open%20issues)](https://github.com/insightsengineering/rtables/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc)\n\n[![CRAN Version](https://www.r-pkg.org/badges/version/rtables)](https://CRAN.R-project.org/package=rtables)\n[![Current Version](https://img.shields.io/github/r-package/v/insightsengineering/rtables/main?color=purple\\\u0026label=Development%20Version)](https://github.com/insightsengineering/rtables/tree/main)\n\u003c!-- end badges --\u003e\n\n## Reporting Tables with R\n\nThe `rtables` R package was designed to create and display complex tables with R. The cells in an `rtable` may contain\nany high-dimensional data structure which can then be displayed with cell-specific formatting instructions. Currently,\n`rtables` can be outputted in `ascii` `html`, and `pdf`, as well Power Point (via conversion to `flextable` objects). `rtf` support is in development and will be in a future release.\n\n`rtables` is developed and copy written by `F. Hoffmann-La Roche` and it is released open source under Apache\nLicense Version 2.\n\n`rtables` development is driven by the need to create regulatory ready tables for health authority review. Some of the key requirements for this undertaking are listed below:\n\n* cell values and their visualization separate (i.e. no string based tables)\n  - values need to be programmatically accessible in their non-rounded state for cross-checking\n* multiple values displayed within a cell\n* flexible tabulation framework\n* flexible formatting (cell spans, rounding, alignment, etc.)\n* multiple output formats (html, ascii, latex, pdf, xml)\n* flexible pagination in both horizontal and vertical directions\n* distinguish between name and label in the data structure to work with `CDISC` standards\n* title, footnotes, cell cell/row/column references\n\n`rtables` currently covers virtually all of these requirements, and further advances remain under active development.\n\n## Installation\n\n`rtables` is available on CRAN and you can install the latest released version with:\n\n```r\ninstall.packages(\"rtables\")\n```\n\nor you can install the latest development version directly from GitHub with:\n\n```r\n# install.packages(\"pak\")\npak::pak(\"insightsengineering/rtables\")\n```\n\nPackaged releases (both those on CRAN and those between official CRAN releases) can be\nfound in the [releases list](https://github.com/insightsengineering/rtables/releases).\n\nTo understand how to use this package, please refer to the [Introduction to `rtables`](https://insightsengineering.github.io/rtables/main/articles/rtables.html) article, which provides multiple examples of code implementation.\n\n## Cheatsheet\n\n\u003ca href=\"https://github.com/insightsengineering/rtables/blob/main/inst/cheatsheet/rtables_cheatsheet_01-24.pdf\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/insightsengineering/rtables/main/inst/cheatsheet/rtables_cheatsheet_01-24_thumbs.png\" width=\"630\" height=\"247\"/\u003e\u003c/a\u003e\n\n## Usage\n\nWe first demonstrate with a demographic table-like example and then show the creation of a more complex table.\n\n```{r, message=FALSE}\nlibrary(rtables)\n\nlyt \u003c- basic_table() %\u003e%\n  split_cols_by(\"ARM\") %\u003e%\n  analyze(c(\"AGE\", \"BMRKR1\", \"BMRKR2\"), function(x, ...) {\n    if (is.numeric(x)) {\n      in_rows(\n        \"Mean (sd)\" = c(mean(x), sd(x)),\n        \"Median\" = median(x),\n        \"Min - Max\" = range(x),\n        .formats = c(\"xx.xx (xx.xx)\", \"xx.xx\", \"xx.xx - xx.xx\")\n      )\n    } else if (is.factor(x) || is.character(x)) {\n      in_rows(.list = list_wrap_x(table)(x))\n    } else {\n      stop(\"type not supported\")\n    }\n  })\n\nbuild_table(lyt, ex_adsl)\n```\n\n```{r, message=FALSE}\nlibrary(rtables)\nlibrary(dplyr)\n\n## for simplicity grab non-sparse subset\nADSL \u003c- ex_adsl %\u003e% filter(RACE %in% levels(RACE)[1:3])\n\nbiomarker_ave \u003c- function(x, ...) {\n  val \u003c- if (length(x) \u003e 0) round(mean(x), 2) else \"no data\"\n  in_rows(\n    \"Biomarker 1 (mean)\" = rcell(val)\n  )\n}\n\nbasic_table(show_colcounts = TRUE) %\u003e%\n  split_cols_by(\"ARM\") %\u003e%\n  split_cols_by(\"BMRKR2\") %\u003e%\n  split_rows_by(\"RACE\", split_fun = trim_levels_in_group(\"SEX\")) %\u003e%\n  split_rows_by(\"SEX\") %\u003e%\n  summarize_row_groups() %\u003e%\n  analyze(\"BMRKR1\", biomarker_ave) %\u003e%\n  build_table(ADSL)\n```\n\n# Acknowledgments\n\nWe would like to thank everyone who has made `rtables` a better project by providing feedback and improving examples \u0026 vignettes. The following list of contributors is alphabetical:\n\nMaximo Carreras, Francois Collins, Saibah Chohan, Tadeusz Lewandowski, Nick Paszty, Nina Qi, Jana Stoilova, Heng Wang, Godwin Yung\n\n## Presentations\n\n- R in Pharma 2023\n  - Generating Tables, Listings, and Graphs using NEST / [cardinal](https://pharmaverse.github.io/cardinal/) [[Video](https://www.youtube.com/watch?v=YPmbLPSYFYM)]\n  - BBS Session on Regulatory Submissions of Clinical Trials [[Video](https://www.youtube.com/watch?v=yZS4OBuJe_Q)]\n- R Medicine Virtual Conference 2023 [[Video](https://www.youtube.com/watch?v=sxFsavKI7s4)]\n- Advanced rtables Training 2023 [[Part 1 Slides](https://github.com/insightsengineering/rtables/blob/main/inst/extdata/Advanced_rtables_part1.pdf)] [[Part 2 Slides](https://github.com/insightsengineering/rtables/blob/main/inst/extdata/Advances_rtables_part2.pdf)]\n- R in Pharma 2022 - Creating Submission-Quality Clinical Trial Reporting Tables in R with rtables [[Slides](https://github.com/insightsengineering/rtables/blob/main/inst/extdata/Clinical_Trial_Reporting_Tables_in_R.pdf)] [[Video](https://www.youtube.com/watch?v=zBm_NZ0VtKs)]\n- R Consortium 2022\n  - R Adoption Series - Reporting Table Creation in R [[Video](https://www.youtube.com/watch?v=1i6vOId2h4A)] [[Slides](https://github.com/insightsengineering/rtables/blob/main/inst/extdata/r_adoption_slides.pdf)]\n  - Tables in Clinical Trials with R [[Book](https://rconsortium.github.io/rtrs-wg/)]\n- useR! 2020 - rtables Layouting and Tabulation Framework [[Video](https://www.youtube.com/watch?v=CBQzZ8ZhXLA)]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finsightsengineering%2Frtables","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finsightsengineering%2Frtables","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finsightsengineering%2Frtables/lists"}