This happened to me by reading in json from a file. The code worked one day, and then the next day I received this error. In the end, I was able to get around the error, although I do not understand why my solution works. Firstly, I found a github post that suggested adding the readLines () function. For instance.
r_object <- fromJSON(readLines("file.json"))
When I did this, json booted correctly, but I received the following warning:
Warning message: In readLines("file.json") : incomplete final line found on 'file.json'.
Then, for some specific reason, I tried to add an extra line at the bottom of the JSON. Just an empty line after the last curly brace. And that fixed it. I do not know why. If anyone knows why this worked, write a comment.
source share