# NOT RUN {
json_flatten(c("[1, 2]", "[3]"))
# names are kep
json_flatten(c(x = "[1, 2]", y = "[3]"))
# scalar elements produce an error ...
try(json_flatten(c(x = "[1, 2]", y = "3")))
# ... but can be explicitly allowed with `allow_scalars`
json_flatten(c(x = "[1, 2]", y = "3"), allow_scalars = TRUE)
# }
Run the code above in your browser using DataLab