jeroen/jsonlite

Partially named lists don't recreate correctly

statasaurus opened this issue · 0 comments

If doesn't have all elements named, numbers get assigned. But when I read the list back in it keeps the numbers as the name.

list(a= 1 , 5, 6,  3) %>% toJSON()

has the following output
{"a":[1],"2":[5],"3":[6],"4":[3]}
But when the output is read back into R with fromJSON() to output is as follows:
image
I would like to be able to go from a partially named list to JSON and then back to the same partially named list