knitr::opts_knit$set(root.dir = rprojroot::find_rstudio_root_file()) # Set WD to Root here::i_am("dev/write-custom-xl.Rmd") library(here) library(tibble) library(openxlsx)
usethis::use_r("write_custom_xlsx")
tbl <- tibble(x = letters[1:2], long_name_column_width = 1:2, another_long_name = 3:4) tbl
lbdoc::write_custom_xlsx(tbl, here("my_data/excel/colWidth_auto_tbl.xlsx"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.