0
當我打電話如何在POSIX和Date對象上使用alignDaily?
alignDaily(DT,include.weekends = FALSE)
得到消息在xy.coords(X,Y)
錯誤:參數「 y「缺失,沒有默認值
str(dt)
表明它是一個POSIXct對象。
當我打電話如何在POSIX和Date對象上使用alignDaily?
alignDaily(DT,include.weekends = FALSE)
得到消息在xy.coords(X,Y)
錯誤:參數「 y「缺失,沒有默認值
str(dt)
表明它是一個POSIXct對象。
將您POSIXct
到timeDate
功能
alignDaily(as.timeDate(DT),include.weekends = FALSE)
的原因是alignDaily
電話align
,其形式爲ANY
,POSIXct
(繼承自ANY)和timeDate
。該ANY
版本(因此POSIXct形式)看起來像這樣
Function: align (package timeDate)
x="ANY"
function (x, ...)
{
.local <- function (x, y, xout, method = "linear", n = 50,
rule = 1, f = 0, ties = mean, ...)
{
ans = approx(x = x, y = y, xout = xout, method = method,
n = n, rule = rule, f = f, ties = ties, ...)
ans
}
.local(x, ...)
}
有沒有辦法強迫alignDaily
發送y
參數。通過將POSIXct
轉換爲timeDate
解決此問題,強制對齊以運行timeDate
方法。