Learn R Programming

⚠️There's a newer version (0.6.4) of this package.Take me there.

ftExtra

The ftExtra package provides helper functions for the flextable package:

  • colformat_md parses markdown texts in columns
  • span_header makes multi-level headers
  • and more!

Installation

from CRAN

install.packages("ftExtra")

from GitHub

options(repos = c(atusy = 'https://atusy.r-universe.dev', getOption("repos")))
install.packages("ftExtra")

Example

library(ftExtra)

Parse markdown texts

data.frame(
  x = c("**bold**", "*italic*"),
  y = c("^superscript^", "~subscript~"),
  z = c("***~ft~^Extra^** is*", "*Cool*"),
  stringsAsFactors = FALSE
) %>%
  as_flextable() %>%
  colformat_md()

Span headers

iris %>%
  head %>%
  as_flextable() %>%
  span_header()

Group rows

library(dplyr, warn.conflicts = FALSE)
iris %>%
  group_by(Species) %>%
  slice(1:2) %>%
  as_flextable()

Copy Link

Version

Install

install.packages('ftExtra')

Monthly Downloads

8,834

Version

0.2.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Atsushi Yasumoto

Last Published

March 28th, 2021

Functions in ftExtra (0.2.0)

with_blanks

Specify blank columns easily via col_keys
span_header

Span the header based on delimiters
reexports

Objects exported from other packages
separate_header

Separate the header based on delimiters
as_paragraph_md

Convert a character vector into markdown paragraph(s)
as_flextable_methods

method to convert object to flextable
colformat_md

Format character columns as markdown text
footnote_options

Options for footnotes