I'm making an app to analyse time series data with Shiny. The data I work with looks like:
V1 V2
1 2013-02-04 18:15:00 -4.746
2 2013-02-04 18:20:00 -4.745
3 2013-02-04 18:25:00 -4.746
4 2013-02-04 18:30:00 -4.747
5 2013-02-04 18:35:00 -4.747
6 2013-02-04 18:40:00 -4.747
I want to plot the data in a table:
output$view <- renderTable({
head(datasubset(),
n=nrow(datasubset()))
})
Doing so I get an error when running Shiny:
Error in Math.POSIXt(x + ifelse(x == 0, 1, 0)) :
'abs' not defined for "POSIXt" objects
Does anyone have a solution for this error?
UPDATE: The error is caused by xtable: renderTable uses xtable() to generate the output, and it looks like xtable doesn't play well with dates in general.
An issue has been filed here by Winston Chang: https://github.com/rstudio/shiny/issues/129
A workaround is available at: R: xtable and dates