From d474224392e514c34a5dd28253bf257fe358ab26 Mon Sep 17 00:00:00 2001 From: Jason Pott <43917006+jasonpott@users.noreply.github.com> Date: Fri, 18 Mar 2022 10:48:02 +0000 Subject: [PATCH] Revise documentation for date format cchanges As requested the changes have been applied to this document. The arrangement of the document differs to that output by the Roxygen document (paramater location). Hopefully it still makes sense. --- R/addDataFrame.R | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/R/addDataFrame.R b/R/addDataFrame.R index 3cdd014..bc52aa6 100644 --- a/R/addDataFrame.R +++ b/R/addDataFrame.R @@ -18,6 +18,11 @@ #' They need to be specified in Java date format #' \url{https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html}. #' +#'Changes to the xlsx date/time formats need to be passed to the R session using the +#'R session function \code{option()} not as an xlsx package parameter. +#' +#'An example of this syntax is shown below as a comment. +#' #' @param x a \code{data.frame}. #' @param sheet a \code{\link{Sheet}} object. #' @param col.names a logical value indicating if the column names of \code{x} @@ -44,6 +49,12 @@ #' @author Adrian Dragulescu #' @examples #' +#' # to change the default date format use something like this +#' # options( +#' # xlsx.date.format = 'dd/MM/YYYY', +#' # xlsx.datetime.format = 'dd/MM/YYYY HH:mm:ss' +#' #) +#' #' #' wb <- createWorkbook() #' sheet <- createSheet(wb, sheetName="addDataFrame1") @@ -59,8 +70,6 @@ #' addDataFrame(data, sheet, startRow=3, startColumn=2, colnamesStyle=cs3, #' rownamesStyle=cs1, colStyle=list(`2`=cs2, `3`=cs2)) #' -#' # to change the default date format use something like this -#' # options(xlsx.date.format="dd MMM, yyyy") #' #' #' # Don't forget to save the workbook ...