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))
  }

Try the l2boost package in your browser

Any scripts or data that you put into this service are public.

l2boost documentation built on Feb. 11, 2022, 5:10 p.m.