calheatmapR

The pletcher dataset is an example of the required format for the calheatmapR function.

data(pletcher)
head(pletcher, 3)
## $`1354406400`
## [1] 70
## 
## $`1354752000`
## [1] 100
## 
## $`1354924800`
## [1] 77

The names of the object are timestamps (in seconds), eg 1354406400 which is 2012-12-02. To create timestamps in R, convert POSIXct class into numeric:

(timestamp <- as.POSIXct("2000-01-01") %>% as.numeric())
## [1] 946684800

To convert a timestamp back to a Date (POSIXct) (if using names from a list, as seen in the pletcher dataset, they will first need converting from character into numeric.

timestamp %>% as.POSIXct(origin = "1970-01-01")
## [1] "2000-01-01 GMT"

So the first value in the pletcher dataset is. (Going a step further and converting the Date into a character, this can then be used as the parameter for the start argument in the chDomain function).

names(pletcher)[1] %>% as.numeric %>% as.POSIXct(origin = "1970-01-01")
## [1] "2012-12-02 GMT"