Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/atusy/ftExtra
Helper functions for the flextable package
https://github.com/atusy/ftExtra
Last synced: 3 months ago
JSON representation
Helper functions for the flextable package
- Host: GitHub
- URL: https://github.com/atusy/ftExtra
- Owner: atusy
- License: other
- Created: 2020-03-12T13:52:01.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-05-10T04:41:29.000Z (6 months ago)
- Last Synced: 2024-07-14T07:46:16.818Z (4 months ago)
- Language: R
- Homepage: https://ftextra.atusy.net/
- Size: 1.41 MB
- Stars: 64
- Watchers: 4
- Forks: 5
- Open Issues: 5
-
Metadata Files:
- Readme: README.Rmd
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - atusy/ftExtra - Helper functions for the flextable package (R)
README
---
output: github_document
---```{r, include = FALSE}
library(knitr)
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)render_html <- function(x, options, ...) {
to <- tempfile(fileext = ".png")
knit_print(structure(
flextable::save_as_image(x, to, webshot = "webshot2"),
class = "webshot"
))
}knitr::opts_chunk$set(
fig.path = "man/figures/"
)
```# ftExtra
[![R-CMD-check](https://github.com/atusy/ftExtra/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/atusy/ftExtra/actions/workflows/R-CMD-check.yaml)
[![CRAN status](https://www.r-pkg.org/badges/version/ftExtra)](https://CRAN.R-project.org/package=ftExtra)
![Downloads](https://cranlogs.r-pkg.org/badges/grand-total/ftExtra)
![Monthly downloads](https://cranlogs.r-pkg.org/badges/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
``` r
install.packages("ftExtra")
```### from GitHub
``` r
options(repos = c(atusy = 'https://atusy.r-universe.dev', getOption("repos")))
install.packages("ftExtra")
```## Example
```{r example, results='hide'}
library(ftExtra)
```### Parse markdown texts
```{r colformat_md, render = render_html}
data.frame(
x = c("**bold**", "*italic*"),
y = c("^superscript^", "~subscript~"),
z = c("***~ft~^Extra^** is*", "*Cool*"),
stringsAsFactors = FALSE
) %>%
flextable() %>%
colformat_md()
```### Span headers
```{r span-header, render = render_html}
iris %>%
head() %>%
flextable() %>%
span_header()
```### Group rows
```{r group-rows, render = render_html}
library(dplyr, warn.conflicts = FALSE)
iris %>%
group_by(Species) %>%
slice(1:2) %>%
flextable()
```