如何检查/检查ui.R
中传递的server.R
输入中的值?
ui.R,
dateInput(inputId = "date_from",
label = "Select time period:",
value = "2014-09-02",
format = "dd-mm-yyyy"),
dateInput(inputId = "date_to",
label = "To:",
value = "2015-02-29",
format = "dd-mm-yyyy")
server.R,
# Connect to the sqlite file.
DB <- dbConnect(SQLite(), dbname = "data/db.sqlite")
# Period.
date_from = input$date_from
date_to = input$date_to
data = dbGetQuery(DB, paste("SELECT * FROM datatable
WHERE DATE(date) BETWEEN '", date_from,"'
AND '", date_to,"'"))
hist(data$humidity, col = "blue")
我不知道如何查看我从ui.R
获得的值,但这是我应该得到的,例如,
2014-09-09 (date_from)
2014-10-09 (date_to)
我上面的代码出现了这个错误,
Error in hist.default(data$humidity, col = "blue") :
invalid number of 'breaks'
有什么想法吗?
修改
使用textOutput
,我会从dateInput
获取奇怪的值,例如16317
04-09-2014
- 这是什么意思?如何将其转换为2014-09-04
(yyyy-mm-dd)?