The rjson::fromJSON() reads a file incorrectly while jsonlite::fromJSON() reads it fine. Here's a sample example.
file test.json contents:
{"name": "Sanjay",
"unit_price": 130848,
"amount": 11,
"up_to_data_sales": 45725}
the jsonlite
fromJSON
outputs:
jsonlite::fromJSON("test.json")
$name
[1] "Sanjay"
$unit_price
[1] 130848
$amount
[1] 11
$up_to_data_sales
[1] 45725
But the same throws an error in rjson
package.
rjson::fromJSON("test.json")
Error in rjson::fromJSON("test.json") : parseTrue: expected to see 'true' - likely an unquoted string starting with 't'.
- Why is this error coming?
- What is the reason
rjson
package was launched whenjsonlite
existed?