r - How do I use alignDaily on POSIX & Date objects? -
when call
aligndaily(dt, include.weekends = false)
i message
error in xy.coords(x, y) : argument "y" missing, no default
str(dt) shows posixct object.
convert posixct timedate function
aligndaily(as.timedate(dt), include.weekends = false)
the reason aligndaily calls align, has forms any, posixct (inherited any) , timedate. any version (and therefore posixct form) looks this
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, ...) } there's no way force aligndaily send y parameter. work around casting posixct timedate, forcing align run timedate method.
Comments
Post a Comment