R/unjson_nested.R

Defines functions unjson_nested

# FIXME: make more robust as we implement all json functions
unjson_nested <- function(data) {
  safe_fromJSON <- function(x) {
    tryCatch(map(x, jsonlite::fromJSON), error = function(e) x)
  }
  mutate(data, across(where(is.character), safe_fromJSON))
}

Try the dm package in your browser

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

dm documentation built on Nov. 2, 2023, 6:07 p.m.