openxlsx2 icon indicating copy to clipboard operation
openxlsx2 copied to clipboard

`options()` tracking

Open jmbarbone opened this issue 2 years ago • 3 comments

Organize and track the potential default options. Most of these actually seem to be related to styles.

In openxlsx these were saved to the named list op.openxlsx and documented (although in the package document, openxlsx).

  • bandedCols
  • bandedRows
  • borderColour
  • borders
  • borderStyle
  • compressionLevel
  • creator (author?)
  • dateFormat, dateformat (just keep one)
  • datetimeFormat, datetimeformat, dateTimeFormat (just keep one)
  • hdpi
  • header
  • headerStyle
  • firstColumn
  • firstFooter
  • firstHeader
  • footer
  • evenFooter
  • evenHeader
  • gridLines
  • keepNA
  • lastColumn
  • na.string
  • maxWidth
  • minWidth
  • numFmt
  • oddFooter
  • oddHeader
  • orientation
  • paperSize
  • showGridLines
  • tabColour
  • tableStyle
  • vdpi
  • withFilter
From `openxlsx::op.openxlsx`
list(
  openxlsx.bandedCols       = FALSE,
  openxlsx.bandedRows       = TRUE,
  openxlsx.borderColour     = "black",
  openxlsx.borders          = NULL,
  openxlsx.borderStyle      = "thin",
  openxlsx.compressionLevel = 9,
  openxlsx.creator          = "",
  openxlsx.dateFormat       = "mm/dd/yyyy",
  openxlsx.datetimeFormat   = "yyyy-mm-dd hh:mm:ss",
  openxlsx.hdpi             = 300,
  openxlsx.header           = NULL,
  openxlsx.headerStyle      = NULL,
  openxlsx.firstColumn      = NULL,
  openxlsx.firstFooter      = NULL,
  openxlsx.firstHeader      = NULL,
  openxlsx.footer           = NULL,
  openxlsx.evenFooter       = NULL,
  openxlsx.evenHeader       = NULL,
  openxlsx.gridLines        = TRUE,
  openxlsx.keepNA           = FALSE,
  openxlsx.lastColumn       = NULL,
  openxlsx.na.string        = NULL,
  openxlsx.maxWidth         = 250,
  openxlsx.minWidth         = 3,
  openxlsx.numFmt           = "GENERAL",
  openxlsx.oddFooter        = NULL,
  openxlsx.oddHeader        = NULL,
  openxlsx.orientation      = "portrait",
  openxlsx.paperSize        = 9,
  openxlsx.showGridLines    = NA,
  openxlsx.tabColour        = NULL,
  openxlsx.tableStyle       = "TableStyleLight9",
  openxlsx.vdpi             = 300,
  openxlsx.withFilter       = NULL
)

jmbarbone avatar Jan 01 '22 18:01 jmbarbone

These will simply be accessed with getOption("pgkname.option") and not the getOps() thing I had implemented in openxlsx

jmbarbone avatar Jan 29 '22 21:01 jmbarbone

Maybe add this to the TODO list after 1.0

Thoughts

  • I updated the docs can be accessed with ?openxlsx2::openxlsx2_options
  • I listed them as I saw them when opening PRs
  • creator could be used in more places
  • Once this is finalized, we can polish the docs a bit more. I like the format the tidyverse has been using lately. https://usethis.r-lib.org/reference/usethis_options.html

olivroy avatar Aug 24 '23 17:08 olivroy

Yes, I we can handle these later. I don't actually think that the average openxlsx2 user is really setting these in their .Rprofile files or other profile setups. But we can always revisit this and add as we please.

JanMarvin avatar Aug 24 '23 17:08 JanMarvin