{"id":18733513,"url":"https://github.com/insightsengineering/rtables.officer","last_synced_at":"2026-01-08T17:21:03.146Z","repository":{"id":258488937,"uuid":"873891708","full_name":"insightsengineering/rtables.officer","owner":"insightsengineering","description":"Reporting tables with R, with officeR support","archived":false,"fork":false,"pushed_at":"2025-12-31T06:01:08.000Z","size":19698,"stargazers_count":4,"open_issues_count":6,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-01-04T03:42:33.439Z","etag":null,"topics":["pharmaceuticals","r","tables"],"latest_commit_sha":null,"homepage":"https://insightsengineering.github.io/rtables.officer/","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":"2024-10-16T22:40:18.000Z","updated_at":"2025-12-31T05:48:07.000Z","dependencies_parsed_at":"2025-04-10T10:46:17.642Z","dependency_job_id":"6ae2e87d-ae68-4115-a1a4-67682cc1fef8","html_url":"https://github.com/insightsengineering/rtables.officer","commit_stats":null,"previous_names":["insightsengineering/rtables.officer"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/insightsengineering/rtables.officer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insightsengineering%2Frtables.officer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insightsengineering%2Frtables.officer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insightsengineering%2Frtables.officer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insightsengineering%2Frtables.officer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/insightsengineering","download_url":"https://codeload.github.com/insightsengineering/rtables.officer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insightsengineering%2Frtables.officer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28247119,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2026-01-08T02:00:06.591Z","response_time":241,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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-11-07T15:10:05.165Z","updated_at":"2026-01-08T17:21:03.131Z","avatar_url":"https://github.com/insightsengineering.png","language":"R","funding_links":["https://pharmaverse.org"],"categories":[],"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.officer))\nsuppressPackageStartupMessages(library(dplyr))\n```\n\n# rtables.officer \u003ca href='https://github.com/insightsengineering/rtables'\u003e\u003cimg src=\"man/figures/logo.png\" align=\"right\" height=\"200\" width=\"200\"/\u003e\u003c/a\u003e\n\n\u003c!-- start badges --\u003e\n[![Check 🛠](https://github.com/insightsengineering/rtables.officer/actions/workflows/check.yaml/badge.svg)](https://github.com/insightsengineering/rtables.officer/actions/workflows/check.yaml)\n[![Docs 📚](https://github.com/insightsengineering/rtables.officer/actions/workflows/docs.yaml/badge.svg)](https://insightsengineering.github.io/rtables.officer/)\n[![Code Coverage 📔](https://raw.githubusercontent.com/insightsengineering/rtables.officer/_xml_coverage_reports/data/main/badge.svg)](https://raw.githubusercontent.com/insightsengineering/rtables.officer/_xml_coverage_reports/data/main/coverage.xml)\n\n![GitHub forks](https://img.shields.io/github/forks/insightsengineering/rtables.officer?style=social)\n![GitHub repo stars](https://img.shields.io/github/stars/insightsengineering/rtables.officer?style=social)\n\n![GitHub commit activity](https://img.shields.io/github/commit-activity/m/insightsengineering/rtables.officer)\n![GitHub contributors](https://img.shields.io/github/contributors/insightsengineering/rtables.officer)\n![GitHub last commit](https://img.shields.io/github/last-commit/insightsengineering/rtables.officer)\n![GitHub pull requests](https://img.shields.io/github/issues-pr/insightsengineering/rtables.officer)\n![GitHub repo size](https://img.shields.io/github/repo-size/insightsengineering/rtables.officer)\n![GitHub language count](https://img.shields.io/github/languages/count/insightsengineering/rtables.officer)\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.officer?color=red\\\u0026label=open%20issues)](https://github.com/insightsengineering/rtables.officer/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc)\n\n[![Current Version](https://img.shields.io/github/r-package/v/insightsengineering/rtables.officer/main?color=purple\\\u0026label=Development%20Version)](https://github.com/insightsengineering/rtables.officer/tree/main)\n\u003c!-- end badges --\u003e\n\n## Exporting `rtables` to Microsoft Word and beyond\n\nThe `rtables.officer` package provides a framework to export tables created with\n[`rtables`](https://github.com/insightsengineering/rtables/) to Microsoft Word documents. To do so,\nwe use the `officer` package to create a Word document and the `flextable` package to produce\nthe intermediary table object that `officer` can use to create the Word document.\n\nPlease refer to the following packages for further information:\n- [`rtables`](https://github.com/insightsengineering/rtables/) to create tables.\n- [`flextable`](https://github.com/davidgohel/flextable) as an intermediate html table object. Many\n  aesthetic functionalities are available at this stage.\n- [`officer`](https://github.com/davidgohel/officer) to create Word documents. Please consider\n  also other exporter options (e.g. `html`) that are available from `flextable`.\n\n`rtables` and `rtables.officer` is developed and copy written by `F. Hoffmann-La Roche` and it is released open source under Apache License Version 2.\n\n## Installation\n\n`rtables.officer` is available on CRAN and you can install the latest released version with:\n\n```r\ninstall.packages(\"rtables.officer\")\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.officer\")\n```\n\n## Example\nHere's a simple example demonstrating how to create a basic table layout, perform analysis on various columns, and export the resultant table to a Word document in landscape orientation. Further reading are available in the [vignettes](https://insightsengineering.github.io/rtables.officer/latest-tag/articles/).\n\n```{r}\n# Define the table layout\nlyt \u003c- basic_table() %\u003e%\n  split_cols_by(\"ARM\") %\u003e%\n  analyze(c(\"AGE\", \"BMRKR2\", \"COUNTRY\"))\n\n# Build the table\ntbl \u003c- build_table(lyt, ex_adsl)\n\n# Export the table to a Word document in landscape orientation\ntf \u003c- tempfile(fileext = \".docx\")\nexport_as_docx(tbl,\n  file = tf,\n  section_properties = section_properties_default(orientation = \"landscape\")\n)\n\n# Expected output (with default theme)\ntt_to_flextable(tbl, theme = theme_docx_default())\n```\n\n## Contributions\nTo contribute to this package, please fork the repository, create a branch, make your changes, and submit a pull request. Your contributions are greatly appreciated!\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finsightsengineering%2Frtables.officer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finsightsengineering%2Frtables.officer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finsightsengineering%2Frtables.officer/lists"}