Export JSON from R

If you want to have have different view:

  • auto_unbox: automatically unbox() all atomic vectors of length 1.
  • pretty: adds indentation whitespace to JSON output.
my_list <- list(
  id = "01522",
  name = "David",
  organization = list(
    id = "AWER12",
    name = "RinteRface",
    site = "Switzerland"
  )
)

toJSON(my_list, auto_unbox = TRUE, pretty = TRUE)