I'm making an app to analyse some data with Shiny.
When I directly send query to database, I can see good rezults:
But when I try to put results from this query to shiny, column 'not_outlier_date' look different:
I want to have the same date format, as in the first picture.
I was trying, on table, that I get from database, add:
not_outlier_dates[,2]<-as.Date(as.numeric(as.vector(unlist(not_outlier_dates[,2]))))
But it doesn't make any changes and works with warning:
Warning in formatC(x = c(16065, 16137, 16064, 15707, 16063, 15775, 15782 :
class of 'x' was discarded
How can I solve this date format problem?
Try using this:
not_outlier_dates[,2] <- as.character(not_outlier_dates[,2])
The problem lies in the xtable
library that Shiny
uses to display tables. It seems there are bugs related to date columns
, as stated in this SO question and this (closed) Shiny issue. Not sure if that still applies or if it applies to your xtable
version, though.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With