R/peel_lists.R

Defines functions peel_lists

Documented in peel_lists

#' peel lists
#'
#' @param x Input data
#' @return Peeled object
#' @export
peel_lists <- function(x) {
  while (is.list(x) && length(x) == 1 && is.recursive(x[[1]])) {
    x <- x[[1]]
  }
  x
}

Try the tfse package in your browser

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

tfse documentation built on May 2, 2019, 11:28 a.m.