R/handle_NA.R

Defines functions handle_NA

#' Set up strategy to handle missing values
#'
#' @noRd
handle_NA <- function(blocks, NA_method = "na.ignore") {
  na.rm <- FALSE
  if (NA_method == "na.omit") blocks <- intersection_list(blocks)
  if (NA_method == "na.ignore") {
    blocks <- blocks
    na.rm <- Reduce("||", lapply(blocks, function(x) any(is.na(x))))
  }
  return(list(blocks = blocks, na.rm = na.rm))
}

Try the RGCCA package in your browser

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

RGCCA documentation built on Oct. 9, 2023, 5:09 p.m.