### Install flexlsx from GitHub Source: https://github.com/pteridin/flexlsx/blob/main/README.md Install the development version of the flexlsx package from GitHub using the remotes package. ```r # install.packages("remotes") remotes::install_github("pteridin/flexlsx") ``` -------------------------------- ### Install flexlsx from CRAN Source: https://github.com/pteridin/flexlsx/blob/main/README.md Install the CRAN release version of the flexlsx package. ```r install.packages("flexlsx") ``` -------------------------------- ### Export flextable to Excel Source: https://github.com/pteridin/flexlsx/blob/main/README.md Create a flextable, add it to an openxlsx2 workbook at a specified cell, and save the workbook to an Excel file. Requires the flextable and openxlsx2 packages. ```r 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) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.