Description
Extensions for 'Flextable'.
Description
Build display tables easily by extending the functionality of the 'flextable' package. Features include spanning header, grouping rows, parsing markdown and so on.
README.md
ftExtra
The ftExtra package provides helper functions for the flextable package:
colformat_md
parses markdown texts in columnsspan_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
) %>%
flextable() %>%
colformat_md()
Span headers
iris %>%
head %>%
flextable() %>%
span_header()
Group rows
library(dplyr, warn.conflicts = FALSE)
iris %>%
group_by(Species) %>%
slice(1:2) %>%
flextable()