Timezone
maelle opened this issue · 0 comments
maelle commented
When I use the code below, the second graph shows time as if it were in UTC, but I'd like to see the IST time. Do I need to change the timezone before plotting?
library("lubridate")
library("vegalite")
library("dplyr")
dateSeq <- seq(from = ymd_hms("2015-01-23 14:22:33"),
length = 1000,
by = "1 min")
data <- data.frame(date = dateSeq,
y = rnorm(n = 1000))
data %>% head()
tz(data$date)
vegalite() %>%
cell_size(300, 300) %>%
add_data(data) %>%
encode_x("date", "temporal") %>%
timeunit_x("yearmonthdayhoursminutesseconds")%>%
encode_y("y", "quantitative") %>%
axis_x(ticks=20)%>%
mark_tick()
data <- mutate(data,
date = force_tz(dateSeq, tz = "Asia/Kolkata"))
data %>% head()
tz(data$date)
vegalite() %>%
cell_size(300, 300) %>%
add_data(data) %>%
encode_x("date", "temporal") %>%
timeunit_x("yearmonthdayhoursminutesseconds")%>%
encode_y("y", "quantitative") %>%
axis_x(ticks=20)%>%
mark_tick()