cellDate: Date cell

Description Usage Arguments Details Value Examples

Description

Creates a cell for a date.

Usage

1
2
3
cellDate(col, row, date, colspan = NULL, rowspan = NULL, comment = NULL,
  commentAuthor = NULL, fontname = NULL, bold = NULL, color = NULL,
  fill = NULL, dateFormat = "yyyy-mm-dd;@", ...)

Arguments

col

integer, the column index

row

integer, the row index

date

an input which will be parsed to a date through the anydate function

colspan

integer, number of columns the cell spans

rowspan

integer, number of rows the cell spans

comment

cell comment, character

commentAuthor

author of the comment, character

fontname

font name; see cell

bold

set TRUE for bold font

color

color name; see cell

fill

color name; see cell

dateFormat

the date format

...

arguments passed to anydate

Details

A date in Excel is stored as an integer: the number of days between this date and a certain origin. The cellDate function calculates this integer and then passes it to the function cell with a date format.

Value

A named list representing a cell.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
A1 <- cellDate(1, 1, "2017-06-14")
unlist(A1)
A1 <- cellDate(1, 1, as.Date(42900, origin="1899-12-30"))
unlist(A1)
A1 <- cellDate(1, 1, "2017/06/14")
unlist(A1)
A1 <- cellDate(1, 1, "20170614")
unlist(A1)
A1 <- cellDate(1, 1, "06-14-2017")
unlist(A1)
A1 <- cellDate(1, 1, "2017-06-14 04:05:06")
unlist(A1)
A1 <- cellDate(1, 1, "2017-06-14 04:05:06", tz="America/Los_Angeles")
unlist(A1)
A1 <- cellDate(1, 1, Sys.Date())
unlist(A1)
A1 <- cellDate(1, 1, "x")
unlist(A1)

stla/hwriteXLSX documentation built on May 7, 2019, 10:40 a.m.