src/library/jsonlite/R/list_to_vec.R

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
  }
}
r-lib/pkgman documentation built on Nov. 18, 2024, 2:23 p.m.