flextable
0.10.3Functions for Tabular Reporting
Overview
Use a grammar for creating and customizing pretty tables. The following formats are supported: 'HTML', 'PDF', 'Typst', 'RTF', 'Microsoft Word', 'Microsoft PowerPoint', R 'Grid Graphics' and 'patchwork'. 'R Markdown', 'Quarto' and the package 'officer' can be used to produce the result files. The syntax is the same for the user regardless of the type of output to be produced. A set of functions allows the creation, definition of cell arrangement, addition of headers or footers, formatting and definition of cell content with text and or images. The package also offers a set of high-level functions that allow tabular reporting of statistical models and the creation of complex cross tabulations.
issues
- fix tests for caption: newer pandoc versions add bookmarks to paragraphs next
to tables that are not table captions, which made the bookmark counts fail
on CRAN.
From NEWS.md in the release
Install
Health
ERRORexamplesr-patched-linux-x86_64, r-release-linux-x86_64, r-release-windows-x86_64
r-patched-linux-x86_64, r-release-linux-x86_64
Running examples in ‘flextable-Ex.R’ failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: as_flextable.TableTree
> ### Title: Transform an rtables object into a flextable
> ### Aliases: as_flextable.TableTree as_flextable.ElementaryTable
>
> ### ** Examples
>
> if (require("rtables", character.only = TRUE, quietly = TRUE)) {
+ library(rtables)
+
+ lyt <- basic_table(title = "Demographic Summary") %>%
+ split_cols_by("ARM") %>%
+ split_rows_by("SEX") %>%
+ analyze("AGE", afun = mean, format = "xx.x")
+
+ tbl <- build_table(lyt, DM)
+ as_flextable(tbl)
+ }
Attaching package: ‘formatters’
The following object is masked from ‘package:base’:
%||%
Attaching package: ‘rtables’
The following object is masked from ‘package:utils’:
str
Error in basic_table(title = "Demographic Summary") %>% split_cols_by("ARM") %>% :
could not find function "%>%"
Execution haltedr-release-windows-x86_64
Running examples in 'flextable-Ex.R' failed
The error most likely occurred in:
> ### Name: as_flextable.TableTree
> ### Title: Transform an rtables object into a flextable
> ### Aliases: as_flextable.TableTree as_flextable.ElementaryTable
>
> ### ** Examples
>
> if (require("rtables", character.only = TRUE, quietly = TRUE)) {
+ library(rtables)
+
+ lyt <- basic_table(title = "Demographic Summary") %>%
+ split_cols_by("ARM") %>%
+ split_rows_by("SEX") %>%
+ analyze("AGE", afun = mean, format = "xx.x")
+
+ tbl <- build_table(lyt, DM)
+ as_flextable(tbl)
+ }
Attaching package: 'formatters'
The following object is masked from 'package:base':
%||%
Attaching package: 'rtables'
The following object is masked from 'package:utils':
str
Error in basic_table(title = "Demographic Summary") %>% split_cols_by("ARM") %>% :
could not find function "%>%"
Execution haltedERRORtestsr-patched-linux-x86_64, r-release-linux-x86_64
r-patched-linux-x86_64
Running ‘testthat.R’ [185s/283s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
> library(testthat)
>
> test_check("flextable")
Loading required package: flextable
Attaching package: 'xtable'
The following object is masked from 'package:flextable':
align
This is mgcv 1.9-4. For overview type '?mgcv'.
Gu & Wahba 4 term additive model
[WARNING] Deprecated: --mathjax. Use --math-method=mathjax[:URL] instead.
[WARNING] Deprecated: --mathjax. Use --math-method=mathjax[:URL] instead.
Saving _problems/test-captions-rmd-128.R
[WARNING] Deprecated: --mathjax. Use --math-method=mathjax[:URL] instead.
Saving _problems/test-captions-rmd-170.R
Loading required package: pdftools
Using poppler version 26.07.0
Attaching package: 'data.table'
The following object is masked from 'package:base':
%notin%
[WARNING] Deprecated: --mathjax. Use --math-method=mathjax[:URL] instead.
`stat_bin()` using `bins = 30`. Pick better value `binwidth`.
[ FAIL 2 | WARN 0 | SKIP 1 | PASS 1090 ]
══ Skipped tests (1) ═══════════════════════════════════════════════════════════
• On CRAN (1): 'test-quarto.R:1:1'
══ Failed tests ════════════════════════════════════════════════════════════════
── Failure ('test-captions-rmd.R:128:3'): with word_document ───────────────────
Expected `bookmarks` to have length 0.
Actual length: 2.
── Failure ('test-captions-rmd.R:170:3'): with word_document2 ──────────────────
Expected `bookmarks` to have length 3.
Actual length: 5.
[ FAIL 2 | WARN 0 | SKIP 1 | PASS 1090 ]
Error:
! Test failures.
Execution haltedr-release-linux-x86_64
Running ‘testthat.R’ [186s/255s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
> library(testthat)
>
> test_check("flextable")
Loading required package: flextable
Attaching package: 'xtable'
The following object is masked from 'package:flextable':
align
This is mgcv 1.9-4. For overview type '?mgcv'.
Gu & Wahba 4 term additive model
[WARNING] Deprecated: --mathjax. Use --math-method=mathjax[:URL] instead.
[WARNING] Deprecated: --mathjax. Use --math-method=mathjax[:URL] instead.
Saving _problems/test-captions-rmd-128.R
[WARNING] Deprecated: --mathjax. Use --math-method=mathjax[:URL] instead.
Saving _problems/test-captions-rmd-170.R
Loading required package: pdftools
Using poppler version 26.07.0
Attaching package: 'data.table'
The following object is masked from 'package:base':
%notin%
[WARNING] Deprecated: --mathjax. Use --math-method=mathjax[:URL] instead.
`stat_bin()` using `bins = 30`. Pick better value `binwidth`.
[ FAIL 2 | WARN 0 | SKIP 1 | PASS 1090 ]
══ Skipped tests (1) ═══════════════════════════════════════════════════════════
• On CRAN (1): 'test-quarto.R:1:1'
══ Failed tests ════════════════════════════════════════════════════════════════
── Failure ('test-captions-rmd.R:128:3'): with word_document ───────────────────
Expected `bookmarks` to have length 0.
Actual length: 2.
── Failure ('test-captions-rmd.R:170:3'): with word_document2 ──────────────────
Expected `bookmarks` to have length 3.
Actual length: 5.
[ FAIL 2 | WARN 0 | SKIP 1 | PASS 1090 ]
Error:
! Test failures.
Execution halted- ERROR10 OK, 3 ERROR2026-10-02
- OK13 OK2026-09-16
- NOTE11 OK, 2 NOTE2026-07-16
- OK13 OK2026-06-09
- ERROR12 OK, 1 ERROR2026-06-08
Show 1 earlier changeHide 1 earlier change
- OK14 OK2026-03-10
Documentation
- Help pages
- 202 (27 internal)includes a package overview page
- Examples that run
- 97%169 run in a plain check (2 of them under a condition) · 6 never run
- Exported functions with examples
- 93%
- Documented parameters
- 92%
- Return-value docs
- 15%
- Help pages citing references
- 0%
- Using flextable HTML
Downloads
Repository
- PRs merged (all time)
- 73%
- Median days to close, 50 most recently updated closed issues
- 48
- Median days to close, 50 most recently updated closed PRs
- 1
Stars over time
Forks over time
Releases over time
Issues over time
Commits over time
Commit identities over time
10 development-tooling and community-health practices detected across 6 families in the upstream repository
Checks run against github.com/davidgohel/flextable on 2026-10-11.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
GitHub Pages site last deployed 2026-10-08 · The repository has a site deploy workflow
pkgdown site last built 2026-10-08, before release 0.10.3 (2026-10-14)
Show all practicesHide 2 practices
Dependencies
Installing flextable adds 57 packages (36 with compiled code, 53 MB of source tarballs). Heaviest: stringi 11 MB, data.table 5.7 MB, bslib 5.6 MB.
Show the 48 most downloaded dependentsHide the 48 most downloaded dependents
and 53 more dependents and 75 packages that suggest it on CRAN ↗
Code & Tests
People & History
Show 4 more contributorsHide 4 contributors
Pick two releases to compare their code metrics.
- 0.10.3Latest2026-10-14 · current release · diff ↗ ·
listed once in CRAN's queue
Seen in one reading of CRAN's incoming queue, at 2026-10-14 10:55 UTC, so it stayed less than the time between readings. - 0.10.12026-09-10 · diff ↗
- 0.10.0
- 0.9.12
- RR 4.6.0 released · 2026-04-24
- 0.9.112026-02-13 · diff ↗ ·
added 6 exports
as_qmd, as_strike, compact_summary, theme_borderless, use_flextable_qmd, wrap_flextable - 0.9.102025-08-24 · diff ↗
- 0.9.92025-05-31 · diff ↗
- 0.9.82025-05-21 · diff ↗
- RR 4.5.0 released · 2025-04-11
- 0.9.72024-10-27 · diff ↗
- 0.9.62024-05-05 · diff ↗
- RR 4.4.0 released · 2024-04-24
- 0.9.52024-03-06 · diff ↗ ·
added 5 exports
fmt_signif_after_zeros, information_data_cell, information_data_chunk, information_data_paragraph, tab_settings - 0.9.4
- 0.9.32023-09-07 · diff ↗
Show 53 earlier eventsHide 53 earlier events
- 0.9.22023-06-18 · diff ↗
- RR 4.3.0 released · 2023-04-21
- 0.9.1
- 0.9.0
- 0.8.6
- 0.8.52023-01-30 · diff ↗
- 0.8.42023-01-21 · diff ↗
- 0.8.32022-11-06 · diff ↗ ·
removed 1 export
xtable_to_flextableadded 5 exports
fmt_avg_dev, fmt_header_n, fmt_n_percent, fmt_summarizor, grid_chunk - 0.8.22022-09-27 · diff ↗
- 0.8.12022-09-19 · diff ↗
- 0.8.0
- 0.7.3
- 0.7.22022-06-12 · diff ↗
- 0.7.12022-06-02 · diff ↗ ·
added 6 exports
add_body_row, as_word_field, prepend_chunks, separate_header, tabulator_colnames, use_model_printer - RR 4.2.0 released · 2022-04-22
- 0.7.02022-03-07 · diff ↗ ·
added 5 exports
add_latex_dep, append_chunks, fmt_2stats, summarizor, tabulator - 0.6.10
- 0.6.9
- 0.6.82021-09-06 · diff ↗
- 0.6.7
- RR 4.1.0 released · 2021-05-18
- 0.6.62021-05-17 · diff ↗
- 0.6.5
- 0.6.4
- 0.6.3
- 0.6.2
- 0.6.1
- 0.6.02020-12-01 · diff ↗ ·
added 9 exports
colformat_date, colformat_datetime, colformat_double, flextable_to_rmd, get_flextable_defaults, gg_chunk, highlight, plot_chunk, set_flextable_defaults - 0.5.11
- 0.5.10
- RR 4.0.0 released · 2020-04-24
- 0.5.92020-03-06 · diff ↗
- 0.5.8
- 0.5.7
- 0.5.6
- 0.5.52019-06-25 · diff ↗ ·
added 8 exports
as_b, as_bracket, as_i, as_sub, as_sup, docx_value, fit_to_width, mk_par - 0.5.4
- RR 3.6.0 released · 2019-04-26
- 0.5.2
- 0.5.12019-02-08 · diff ↗ ·
added 12 exports
add_footer_lines, add_footer_row, add_header_lines, add_header_row, align_nottext_col, align_text_col, as_flextable, as_grouped_data, fix_border_issues, merge_h_range, theme_alafoli, theme_vader - 0.5.0
- 0.4.62018-10-31 · diff ↗ ·
added 4 exports
body_replace_flextable_at_bkm, colformat_char, colformat_int, colformat_num - 0.4.5
- RR 3.5.0 released · 2018-04-23
- 0.4.42018-04-20 · diff ↗
- 0.4.32018-03-14 · diff ↗ ·
added 13 exports
border_inner_h, border_inner_v, border_outer, border_remove, font, hline, hline_bottom, hline_top, hyperlink_text, set_footer_df, vline, vline_left, vline_right - 0.4.22018-01-10 · diff ↗ ·
removed 1 export
tabwidadded 5 exports
add_footer, delete_part, height_all, htmltools_value, xtable_to_flextable - 0.4.0
- 0.3.0
- 0.2.0
- RR 3.4.0 released · 2017-04-21
- 0.1.02017-03-28
- RR 3.3.0 released · 2016-05-03
Package metadata
- First published
- 2017-03-28
- Total releases
- 58 / 9 yrs
- License
- GPL-3 OSI
- Download size
- 451 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("flextable")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-17, which the citation names so these numbers can be found later. More on citing and the projects behind them.