不知道如何将'date'转换为class“Date”?

时间:2017-03-27 14:45:32

标签: r shiny

为什么我在下面这一行的RStudio上收到错误:

# Calculate the end day of current month.
# example: 2016-07-31
endDayOfCurrentMonth <- as.Date(format(as.Date(format(as.Date(Sys.Date(),"%Y%m%d"), "%Y%m01"),"%Y%m%d") +31,"%Y%m01"), "%Y%m%d") -1

错误:

  

不知道如何将'date'转换为类“Date”

在我的RStudio控制台中:

Listening on http://127.0.0.1:5097
Warning in data.matrix(data) : NAs introduced by coercion
Warning in data.matrix(data) : NAs introduced by coercion
Warning in data.matrix(data) : NAs introduced by coercion
Warning: Error in as.Date.default: do not know how to convert 'date' to class “Date”
Stack trace (innermost first):
    105: as.Date.default
    104: as.Date
    103: filter
    102: _f [source/function/getStreamDf.R#46]
    101: withVisible
    100: rr
     99: renderPlot [/var/srv/shiny-server/dustboxes/dustbox1/server.R#91]
     89: <reactive:plotObj>
     78: plotObj
     77: origRenderFunc
     76: output$plot
      1: runApp

有什么想法吗?

0 个答案:

没有答案