How to force RJSONIO::fromJSON to read numbers as characters?

207 Views Asked by At

I have a Json that contains data such as "id" : "165436382098949", but when I try to parse the string using fromJSON, I get something as

$data[[1]]$id
[1] 1.654364e+14

Which is a nuisance since I need the exact id to perform requests. How can I force fromJSON to read all fields as characters?

Edit: example

> x <- fromJSON('[{"id" : 323907258301939713}]')
> as.character(x)
[1] "323907258301939712"
0

There are 0 best solutions below