exportxlsx: Export a flextable into a .xlsx file

View source: R/exportxlsx.R

exportxlsxR Documentation

Export a flextable into a .xlsx file

Description

Export a flextable into a .xlsx file

Usage

exportxlsx(table, path)

Arguments

table

A flextable

path

Path to the Excel file to be created

Value

Returns an .xlsx file based on a flextable

Examples

## Not run: 
ft <- flextable::flextable(head(mtcars))
# color some cells in blue
ft <- flextable::bg(ft, i=ft$body$dataset$disp>200, j=3, bg = "#7ed6df", part = "body")
# color a few cells in yellow
ft <- flextable::bg(ft, i=ft$body$dataset$vs==0, j=8, bg = "#FCEC20", part = "body")
# export your flextable as a .xlsx in the current working directory
exportxlsx(ft, filename ="myFlextable", path="path/to/the/excel_file.xlsx")

## End(Not run)

Sebastien-Le/YesSiR documentation built on Sept. 3, 2023, 8:53 a.m.