Package: flextable 0.9.12.005

flextable: Functions for Tabular Reporting

Use a grammar for creating and customizing pretty tables. The following formats are supported: 'HTML', 'PDF', '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.

Authors:David Gohel [aut, cre], ArData [cph], Clementine Jager [ctb], Eli Daniels [ctb], Panagiotis Skintzos [aut], Quentin Fazilleau [ctb], Maxim Nazarov [ctb], Titouan Robert [ctb], Michael Barrowman [ctb], Atsushi Yasumoto [ctb], Paul Julian [ctb], Sean Browning [ctb], Rémi Thériault [ctb], Samuel Jobert [ctb], Keith Newman [ctb]

flextable_0.9.12.005.tar.gz
flextable_0.9.12.005.zip(r-4.6)flextable_0.9.12.005.zip(r-4.5)flextable_0.9.12.005.zip(r-4.4)
flextable_0.9.12.005.tgz(r-4.6-any)flextable_0.9.12.005.tgz(r-4.5-any)
flextable_0.9.12.005.tar.gz(r-4.6-any)flextable_0.9.12.005.tar.gz(r-4.5-any)
flextable_0.9.12.005.tgz(r-4.5-emscripten)
flextable.pdf |flextable.html
flextable/json (API)
NEWS

# Install 'flextable' in R:
install.packages('flextable', repos = c('https://davidgohel.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/davidgohel/flextable/issues

Pkgdown/docs site:https://davidgohel.github.io

On CRAN:

Conda:

docxhtml5ms-office-documentsrmarkdowntable

17.55 score 617 stars 149 packages 11k scripts 88k downloads 6 mentions 164 exports 57 dependencies

Last updated from:fbc4542284. Checks:9 OK. Indexed: yes.

TargetResultTotal timeArtifact
linux-devel-x86_64OK285
source / vignettesOK245
linux-release-x86_64OK269
macos-devel-arm64OK204
macos-release-arm64OK149
windows-develOK259
windows-releaseOK287
windows-oldrelOK261
wasm-releaseOK148

Exports:add_bodyadd_body_rowadd_footeradd_footer_linesadd_footer_rowadd_headeradd_header_linesadd_header_rowadd_latex_depalignalign_nottext_colalign_text_colappend_chunksas_bas_bracketas_chunkas_equationas_flextableas_grouped_dataas_highlightas_ias_imageas_paragraphas_qmdas_rasteras_strikeas_subas_supas_word_fieldautofitbeforebgbody_add_flextablebody_replace_flextable_at_bkmboldborderborder_innerborder_inner_hborder_inner_vborder_outerborder_removechunk_dataframecolformat_charcolformat_datecolformat_datetimecolformat_doublecolformat_imagecolformat_intcolformat_lglcolformat_numcolorcolorizecompact_summarycomposecontinuous_summarydelete_columnsdelete_partdelete_rowsdf_printerdim_prettyempty_blanksfit_to_widthfix_border_issuesflextableflextable_dimflextable_html_dependencyflextable_to_rmdfmt_2statsfmt_avg_devfmt_dblfmt_header_nfmt_intfmt_n_percentfmt_pctfmt_signif_after_zerosfmt_summarizorfontfontsizefooters_flextable_at_bkmfootnotefp_border_defaultfp_text_defaultgen_grobget_flextable_defaultsgg_chunkgrid_chunkheaders_flextable_at_bkmheightheight_allhighlighthlinehline_bottomhline_tophrulehtmltools_valuehyperlink_textinformation_data_cellinformation_data_chunkinformation_data_paragraphinit_flextable_defaultsitalickeep_with_nextlabelizorline_spacinglinerangelollipopmerge_atmerge_hmerge_h_rangemerge_nonemerge_vminibarmk_parncol_keysnrow_partpaddingpaginateplot_chunkprepend_chunksproc_freqqflextableregulartablerotatesave_as_docxsave_as_htmlsave_as_imagesave_as_pptxsave_as_rtfseparate_headerset_captionset_flextable_defaultsset_footer_dfset_formatterset_formatter_typeset_header_dfset_header_labelsset_table_propertiesshift_tablestylesummarizorsurroundtab_settingstabulatortabulator_colnamestheme_alafolitheme_apatheme_booktabstheme_borderlesstheme_boxtheme_trontheme_tron_legacytheme_vadertheme_vanillatheme_zebrause_df_printeruse_flextable_qmduse_model_printervalignvlinevline_leftvline_rightvoidwidthwrap_flextable

Dependencies:askpassbase64encbslibcachemclicpp11data.tabledigestdplyrevaluatefastmapfontawesomefontBitstreamVerafontLiberationfontquiverfsgdtoolsgenericsgluehighrhtmltoolsjquerylibjsonliteknitrlifecyclemagrittrmemoisemimeofficeropensslpillarpkgconfigpurrrR6raggrappdirsRcpprlangrmarkdownsassstringistringrsyssystemfontstextshapingtibbletidyrtidyselecttinytexutf8uuidvctrswithrxfunxml2yamlzip

Using flextable

Rendered fromoverview.Rmdusingknitr::rmarkdownon Feb 22 2026.

Last update: 2021-02-01
Started: 2017-03-24

Readme and manuals

Help Manual

Help pageTopics
flextable: Functions for Tabular Reportingflextable-package
Add body rows with one value per columnadd_body
Add a body row with spanning labelsadd_body_row
Add footer rows with one value per columnadd_footer
Add full-width rows to the footeradd_footer_lines
Add a footer row with spanning labelsadd_footer_row
Add header rows with one value per columnadd_header
Add full-width rows to the headeradd_header_lines
Add a header row with spanning labelsadd_header_row
Set text alignmentalign align_nottext_col align_text_col
Append chunks to flextable contentappend_chunks
Bold chunkas_b
Bracket chunkas_bracket
Text chunkas_chunk
Equation chunkas_equation
Method to transform objects into flextablesas_flextable
Transform a 'compact_summary' object into a flextableas_flextable.compact_summary
Transform and summarise a 'data.frame' into a flextable Simple summary of a data.frame as a flextableas_flextable.data.frame
Transform a 'gam' model into a flextableas_flextable.gam
Transform a 'glm' object into a flextableas_flextable.glm
Transform a 'grouped_data' object into a flextableas_flextable.grouped_data
Transform a 'htest' object into a flextableas_flextable.htest
Transform a 'kmeans' object into a flextableas_flextable.kmeans
Transform a 'lm' object into a flextableas_flextable.lm
Transform a 'merMod' or 'lme' object into a flextableas_flextable.brmsfit as_flextable.glmmadmb as_flextable.glmmTMB as_flextable.gls as_flextable.lme as_flextable.merMod as_flextable.nlme
Transform a 'pam' object into a flextableas_flextable.pam
Transform a 'summarizor' object into a flextableas_flextable.summarizor
Transform a 'table' object into a flextableas_flextable.table
Transform a 'tables::tabular' object into a flextableas_flextable.tabular
Transform a 'tabulator' object into a flextableas_flextable.tabulator
Transform a 'xtable' object into a flextableas_flextable.xtable
Insert group-label rows into a data frameas_grouped_data
Highlight chunkas_highlight
Italic chunkas_i
Image chunkas_image
Build a paragraph from chunksas_paragraph
Quarto inline markdown chunkas_qmd
Strikethrough chunkas_strike
Subscript chunkas_sub
Superscript chunkas_sup
Word dynamic field chunkas_word_field
Adjust cell widths and heightsautofit
Detect rows before a given valuebefore
Set background colorbg
Add flextable into a Word documentbody_add_flextable
Add flextable at bookmark location in a Word documentbody_replace_flextable_at_bkm
Set bold fontbold
Set all inner bordersborder_inner
Set inner horizontal bordersborder_inner_h
Set inner vertical bordersborder_inner_v
Set outer bordersborder_outer
Remove bordersborder_remove
Format character cellscolformat_char
Format date cellscolformat_date
Format datetime cellscolformat_datetime
Format double cellscolformat_double
Format cells as imagescolformat_image
Format integer cellscolformat_int
Format logical cellscolformat_lgl
Format numeric cells with format()colformat_num
Set font colorcolor
Colorize chunkcolorize
Compact Summary of a Datasetcompact_summary
Set cell content from paragraph chunkscompose mk_par
Summarize continuous variables as a flextablecontinuous_summary
Delete flextable columnsdelete_columns
Delete flextable partdelete_part
Delete flextable rowsdelete_rows
data.frame automatic printing as a flextabledf_printer
Calculate optimal column widths and row heightsdim_pretty
Get column widths and row heights of a flextabledim.flextable
Get optimal width and height of a flextable grobdim.flextableGrob
Make blank columns transparentempty_blanks
Fit a flextable to a maximum widthfit_to_width
Create a flextable from a data frameflextable qflextable
Get overall width and height of a flextableflextable_dim
Print a flextable inside knitr loops and conditionalsflextable_to_rmd
Format summarizor statistics as textfmt_2stats fmt_summarizor
Format mean and standard deviation as textfmt_avg_dev
Format numbers as doublesfmt_dbl
Format count as '(N=XX)' for column headersfmt_header_n
Format numbers as integersfmt_int
Format count and percentage as textfmt_n_percent
Format numbers as percentagesfmt_pct
Format with significant figures after zerosfmt_signif_after_zeros
Set fontfont
Set font sizefontsize
Add footnotes to flextablefootnote
Create border formatting with flextable defaultsfp_border_default
Create text formatting with flextable defaultsfp_text_default
Render a flextable as a graphic objectgen_grob
Get flextable defaults formatting propertiesget_flextable_defaults
ggplot chunkgg_chunk
Grid Graphics chunkgrid_chunk
Set flextable rows heightheight height_all
Set text highlight colorhighlight
Set horizontal borders below selected rowshline
Set the bottom border of a table parthline_bottom
Set the top border of a table parthline_top
Set how row heights are determinedhrule
Convert a flextable to an HTML objecthtmltools_value
Hyperlink chunkhyperlink_text
Set italic fontitalic
Set Word 'Keep with next' instructionskeep_with_next
Render flextable in knitr documentsknit_print.flextable
Replace displayed text with labelslabelizor
Set line spacingline_spacing
Mini linerange chunklinerange
Merge flextable cells into a single onemerge_at
Merge flextable cells horizontallymerge_h
Rowwise merge of a range of columnsmerge_h_range
Delete flextable merging informationmerge_none
Merge flextable cells verticallymerge_v
Mini barplot chunkminibar
Number of columnsncol_keys
Number of rows of a partnrow_part
Set paragraph paddingspadding
Prevent page breaks inside a flextablepaginate
Add a flextable into a PowerPoint slideph_with.flextable
Mini plot chunkplot_chunk
Plot a flextableplot.flextable
plot a flextable grobplot.flextableGrob
Prepend chunks to flextable contentprepend_chunks
Print a flextableprint.flextable
Frequency tableproc_freq
Rotate cell textrotate
Add a 'flextable' into an RTF documentrtf_add.flextable
Save flextable objects in a 'Word' filesave_as_docx
Save flextable objects in an 'HTML' filesave_as_html
Save a flextable in a 'png' or 'svg' filesave_as_image
Save flextable objects in a 'PowerPoint' filesave_as_pptx
Save flextable objects in an 'RTF' filesave_as_rtf
Split column names using a separator into multiple rowsseparate_header
Set flextable captionset_caption
Modify flextable defaults formatting propertiesinit_flextable_defaults set_flextable_defaults
Set column formatter functionsset_formatter
Replace the entire header or footer from a data frameset_footer_df set_header_df set_header_footer_df
Rename column labels in the headerset_header_labels
Set table layout and width propertiesset_table_properties
Create a shift tableshift_table
Set formatting properties on a flextable selectionstyle
Prepare descriptive statistics for flextablesummarizor
Surround cells with borderssurround
Set tabulation marks configurationtab_settings
Create pivot-style summary tablessummary.tabulator tabulator
Column keys of tabulator objectstabulator_colnames
Apply alafoli themetheme_alafoli
Apply APA themetheme_apa
Apply booktabs themetheme_booktabs
Apply borderless themetheme_borderless
Apply box themetheme_box
Apply tron themetheme_tron
Apply tron legacy themetheme_tron_legacy
Apply Sith Lord Darth Vader themetheme_vader
Apply vanilla themetheme_vanilla
Apply zebra themetheme_zebra
Get HTML code as a stringto_html.flextable
Set data.frame automatic printing as a flextableuse_df_printer
Install the flextable-qmd Quarto extensionuse_flextable_qmd
Set automatic flextable printing for modelsuse_model_printer
Set vertical alignmentvalign
Set vertical borders to the right of selected columnsvline
Set the left border of the tablevline_left
Set the right border of the tablevline_right
Clear the displayed content of selected columnsvoid
Set columns widthwidth
Wrap a flextable for use with patchworkwrap_flextable

  • Image