2016-04-21 12 views

回答

0

將您POSIXcttimeDate功能

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方法。

相關問題