tests/testthat/helper-toJSON.R

toJSON <- function(...) {
  unclass(jsonlite::toJSON(...))
}

toJSON2 <- function(x) {
  toJSON(x, keep_vec_names = TRUE, auto_unbox = TRUE)
}

toJSON3 <- function(x) {
  toJSON(x, keep_vec_names = TRUE, auto_unbox = TRUE, dataframe = "columns", rownames = FALSE)
}

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.