R/list_to_vec.R

Defines functions list_to_vec

list_to_vec <- function(x) {
  isdates <- is_datelist(x)
  out <- unlist(null_to_na(x), recursive = FALSE, use.names = FALSE)
  if (isdates && is.numeric(out)) {
    structure(out, class = c("POSIXct", "POSIXt"))
  } else {
    out
  }
}

Try the jsonlite package in your browser

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

jsonlite documentation built on April 4, 2025, 5:24 a.m.