R/rmNullObs.R

Defines functions rmNullObs

Documented in rmNullObs

#' @title rmNullObs
#' @description Removes null objects from a nested list.
#' @param x list
#' @return list
#' @keywords internal
rmNullObs <- function(x) {
  if (!(is.function(x))) {
    x <- x[!(sapply(x, is.NullOb))]
    lapply(x, function(x) if (is.list(x)) rmNullObs(x) else x)
  }
}

Try the ggedit package in your browser

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

ggedit documentation built on May 29, 2024, 3:07 a.m.