davidgohel / ftExtra

Helper functions for the flextable package

Home Page:https://ftextra.atusy.net/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ftExtra

R build status CRAN status Downloads Monthly downloads

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()

About

Helper functions for the flextable package

https://ftextra.atusy.net/

License:Other


Languages

Language:R 86.3%Language:Lua 13.7%