R/val2ret.R

Defines functions val2ret

Documented in val2ret

#' Convert values/prices to returns
#'
#' @name val2ret
#' @param method "discrete","log"
#' @param na_omit NA omit FALSE/TRUE
val2ret <- function(method = "discrete",na_omit = FALSE) {
  self <- self$clone()
  .data <- self$.data
  if (na_omit) {
    .data <- stats::na.omit(.data)
  }
  self$.data <- PerformanceAnalytics::Return.calculate(prices = .data,method = method)
  self
}
maxto/ubiqueR documentation built on Nov. 22, 2017, 12:04 a.m.