Skip to content
/ flexlsx Public

❗ This is a read-only mirror of the CRAN R package repository. flexlsx — Exporting 'flextable' to 'xlsx' Files. Homepage: https://github.com/pteridin/flexlsx Report bugs for this package: https://github.com/pteridin/flexlsx/issues

License

Notifications You must be signed in to change notification settings

cran/flexlsx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flexlsx

Lifecycle: experimental Codecov test coverage R-CMD-check

The primary objective of flexlsx is to offer an effortless interface for exporting flextable objects directly to Microsoft Excel. Building upon the robust foundation provided by openxlsx2 and flextable, flexlsx ensures compatibility, precision, and efficiency when working with both trivial and complex tables.

Installation

You can install the development version of flexlsx like so:

# install.packages("remotes")
remotes::install_github("pteridin/flexlsx")

Or install the CRAN release like so:

install.packages("flexlsx")

Example

This is a basic example which shows you how to solve a common problem:

library(flexlsx)

# Create a flextable and an openxlsx2 workbook
ft <- flextable::as_flextable(table(mtcars[,1:2]))
wb <- openxlsx2::wb_workbook()$add_worksheet("mtcars")

# add the flextable ft to the workbook, sheet "mtcars"
# offset the table to cell 'C2'
wb <- wb_add_flextable(wb, "mtcars", ft, dims = "C2")

# save the workbook to a temporary xlsx file
tmpfile <- tempfile(fileext = ".xlsx")
wb$save(tmpfile)

About

❗ This is a read-only mirror of the CRAN R package repository. flexlsx — Exporting 'flextable' to 'xlsx' Files. Homepage: https://github.com/pteridin/flexlsx Report bugs for this package: https://github.com/pteridin/flexlsx/issues

Resources

License

Stars

Watchers

Forks

Packages

No packages published