google / google/CausalImpact

Period marker only works with Date object

Open
#10 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
R
Stars
1.9k
Forks
264
PR merge metrics
No merged PRs in 30d

Description

The `plot` function only plots the period marker if the time index is a `Date` object, and fails to plot for `'DateTime`/`POSIX` index (e.g. 2017-02-02 03:00).

It seems concatenating a `POSIX` timestamp with `NULL` (e.g. https://github.com/google/CausalImpact/blob/master/R/impact_plot.R#L82) does not really work

> c(NULL,strptime('2017-02-02 03:00','%Y-%m-%d %H:00'))
$sec
[1] 0

$min
[1] 0

$hour
[1] 3

$mday
[1] 2

$mon
[1] 1

$year
[1] 117

$wday
[1] 4

$yday
[1] 32

$isdst
[1] 0

$zone
[1] "CET"

$gmtoff
[1] NA

whereas `c(NULL,as.Date('2014-02-01'))` returns the expected value.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.