I am creating a JSON file in R:
test <- c(list(item1 = "TEXT",
item2 = as.array(list(start = 0,
end = 99))))
write_json(test, path = "test.json" , auto_unbox = TRUE , null = "null")
which results in :
{"item1":"INDIVIDUAL_AGE","item2":{"start":[0],"end":[99]}}
however I need the result to be:
{"item1":"INDIVIDUAL_AGE","item2":{"start":0,"end":99}}
how can I get rid of the square brackets from item2 elements?