{"id":48281409,"url":"https://github.com/insightsengineering/pager","last_synced_at":"2026-04-04T22:47:37.250Z","repository":{"id":311849996,"uuid":"1045265068","full_name":"insightsengineering/pager","owner":"insightsengineering","description":"Save multipage tables as 'Word' documents via 'rmarkdown'","archived":false,"fork":false,"pushed_at":"2026-03-02T07:54:35.000Z","size":145,"stargazers_count":2,"open_issues_count":16,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-02T11:53:52.615Z","etag":null,"topics":["r"],"latest_commit_sha":null,"homepage":"https://insightsengineering.github.io/pager/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/insightsengineering.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"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":"2025-08-26T22:43:32.000Z","updated_at":"2026-03-02T07:52:52.000Z","dependencies_parsed_at":"2025-08-27T09:55:26.403Z","dependency_job_id":"09f54e65-65ef-4418-bfc4-87a5e87224ca","html_url":"https://github.com/insightsengineering/pager","commit_stats":null,"previous_names":["insightsengineering/pager"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/insightsengineering/pager","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insightsengineering%2Fpager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insightsengineering%2Fpager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insightsengineering%2Fpager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insightsengineering%2Fpager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/insightsengineering","download_url":"https://codeload.github.com/insightsengineering/pager/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insightsengineering%2Fpager/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31418270,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T20:09:54.854Z","status":"ssl_error","status_checked_at":"2026-04-04T20:09:44.350Z","response_time":60,"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":["r"],"created_at":"2026-04-04T22:47:34.494Z","updated_at":"2026-04-04T22:47:37.237Z","avatar_url":"https://github.com/insightsengineering.png","language":"R","funding_links":["https://pharmaverse.org"],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n# pager\n\n\u003c!-- badges: start --\u003e\n[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)\n[![CRAN status](https://www.r-pkg.org/badges/version/pager)](https://CRAN.R-project.org/package=pager)\n[![R-CMD-check](https://github.com/insightsengineering/pager/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/insightsengineering/pager/actions/workflows/R-CMD-check.yaml)\n[![Codecov test coverage](https://codecov.io/gh/insightsengineering/pager/graph/badge.svg)](https://app.codecov.io/gh/insightsengineering/pager)\n\u003c!-- badges: end --\u003e\n\nThe pager package makes it simple to save tables and plots as Word, HTML, or plain text documents.\nTables of class `gtsummary`, `gt`, and `flextable`, as well as `ggplot` and `grob` plots, are supported.\nThis is accomplished by rendering the objects via R Markdown.\n\nThe package also supports lists of objects.\nWhen a list is passed, each element is placed on a separate page (Word), separated by a horizontal rule (HTML), or separated by a horizontal rule (plain text).\n\n## Installation\n\nYou can install the development version of pager from [GitHub](https://github.com/) with:\n\n``` r\n# install.packages(\"pak\")\npak::pak(\"insightsengineering/pager\")\n```\n\n## Example\n\nTo begin, let's create a summary table.\n\n``` r\nlibrary(pager)\n\n# create table\ntbl \u003c-\n  cards::ADAE[1:150, ] |\u003e\n  gtsummary::tbl_hierarchical(\n    variables = c(AESOC, AETERM),\n    by = TRTA,\n    denominator = cards::ADSL,\n    id = USUBJID,\n  )\n```\n\n### Word (.docx)\n\nThe code below will save the table as a Word document using the default portrait orientation reference document.\n\n``` r\ngtsummary::as_flex_table(tbl) |\u003e\n  save_docx(path = tempfile(fileext = \".docx\"))\n```\n\nThe example below first splits the summary table into a list of tables.\nEach table is saved to a separate page in the resulting Word document.\n\n``` r\ngtsummary::tbl_split_by_rows(tbl, row_numbers = seq(20, nrow(tbl), by = 20)) |\u003e\n  save_docx(path = tempfile(fileext = \".docx\"))\n```\n\n### HTML (.html)\n\nThe code below will save the table as a self-contained HTML file.\n\n``` r\ntbl |\u003e\n  gtsummary::as_gt() |\u003e\n  save_html(path = tempfile(fileext = \".html\"))\n```\n\nA paginated table can also be saved as HTML — each page is separated by a horizontal rule.\n\n``` r\ngtsummary::tbl_split_by_rows(tbl, row_numbers = seq(20, nrow(tbl), by = 20)) |\u003e\n  save_html(path = tempfile(fileext = \".html\"))\n```\n\n### Plain text (.txt)\n\nThe code below will save the table as a plain text (Markdown-formatted) file.\n\n``` r\ntbl |\u003e\n  save_txt(path = tempfile(fileext = \".txt\"))\n```\n\n`save_txt()` also accepts `gt` tables directly.\n\n``` r\ngt::gt(head(mtcars)) |\u003e\n  save_txt(path = tempfile(fileext = \".txt\"))\n```\n\nA list of tables can also be saved as plain text — each table is separated by a horizontal rule.\n\n``` r\nlist(gt::gt(head(mtcars)), gt::gt(tail(mtcars))) |\u003e\n  save_txt(path = tempfile(fileext = \".txt\"))\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finsightsengineering%2Fpager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finsightsengineering%2Fpager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finsightsengineering%2Fpager/lists"}