search for: timetk

Displaying 1 result from an estimated 1 matches for "timetk".

Did you mean: timet
2017 Oct 18
1
Problem with tq_mutate_xy() from the tidyquant package
...-01") + 1:100 locL <- list( foo=xts(rnorm(100), order.by=dtV), bar=xts(rnorm(100), order.by=dtV) ) fullXts <- do.call(merge,locL) smallXts <- fullXts["2017-02-01::"] rolling_corrOnePair <- function( aXts, col1, col2, window ) { #window = window size in days tbl <- timetk::tk_tbl( aXts[,c(col1,col2)], rename_index="date" ) colnames(tbl) <- c("date","x","y") naV <- sapply(1:nrow(tbl), function(i) any(is.na(tbl[i,])) ) tbl <- tbl[!naV,]# remove any rows with NAs tq_mutate_xy( data=tbl, x = x, y = y, mutate_fun=...