#' fun_Lag_df
#'
#' @param Df List with volatility adjusted excess return
#' @param lag number of lags between period
#'
#' @return Date frame (xts, zoo) with excess return adjusted for volatility and with ags
#'
#' @export
#'
fun_Lag_df <- function(df, lag) {
x <- df
nameVol = as.numeric(c(rep(NA, lag), x[-c((nrow(x) - lag + 1):nrow(x)), "exReVol"]))
nameSign = sign(nameVol)
out <- cbind(x, nameVol, nameSign)
colnames(out) <- c(colnames(x), paste0("exReVol_lag", lag),
paste0("exReVolSign_lag", lag))
return(out)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.