R/VAR.R

Defines functions VAR

Documented in VAR

#' This is a hidden function of the l2boost package.

#' VAR is a helper function that specifically returns NA if all 
#' values of the argument x are NA, otherwise, it returns a var 
#' object.
#' 
#' @param x return variance of x matrix.
#'
#' @importFrom stats var
VAR <- function(x) {
  if (all(is.na(x))) return(NA) 
  else 
  return(var(x, na.rm=T))
  }
ehrlinger/l2boost documentation built on April 28, 2022, 7:29 a.m.