jsonlite::fromJSON is not working properly - r

I am trying to read in a JSON file (that I unfortunately cannot post here) into R using the fromJSON function from the jsonlite package.
Thereby, I always get a parsing error and I don't know why. The really strange thing is that I have two versions of the same file that appear absolutely the same to me in e.g. jsonformatter.org .
Does anyone know this error or how to track it? Is there another good way to read in JSON files into R?
Here is the error message:
Error in parse_con(txt, bigint_as_char) :
lexical error: invalid char in json text.
ÿþ{ (right here) ------^

Related

Error message in Ferret related to a netcdf file

I am actually trying to open a netcdf file with 'Ferret' and I get this error message.
In sum up, when trying to open the file:
use all_sondes_test.nc
I get the following message:
NetCDF: Not a valid data type or _FillValue type mismatch (OPeNDAP/netCDF Error code -45) is this a CDF file ?
I hope the problem looks clear to the community.
I have already tried to find some help on the web, without any success.
Thanks for your help !

Error: object not found after being defined in R

I have just started using R, and I seem to be falling over at the first hurdle...
I have defined an object in my R project which is the csv data for a file I have stored on my PC:
rgvaAssessment<-read.csv("C:\\Users\\cheddar\\Downloads\\attachments\\rgva_assessment X.csv")
However, when I type the object name in the R console, I get the following error:
> rgvaAssessment
Error: object 'rgvaAssessment' not found
Could someone please let me know what obvious error I am making here? The file definitely exists in the defined location.
Thanks

Getting errors when trying to compile on Qt creator (warning treated as error)

I have been trying to compile some source codes that i got off github (qgroundcontrol) but am having constant errors and i am having difficulties fixing it..
I always get these same recurring problems;
error: C2220: warning treated as error - no 'object' file generated
warning: C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss
warning treated as error when building
Occasionally, you have invisible Unicode characters in a line. If it happens in a single line, cut out the complete line and type it again - do not copy/paste as invariably you will get the strange character in again.
If you have a suitable editor, e.g. BBEDit, you could search / replace these characters.

Text mining with tm in R antiword error

So I'm rather new to R, and I'm learning how to mine text from this handy website: https://eight2late.wordpress.com/2015/05/27/a-gentle-introduction-to-text-mining-using-r/
I do have my own text set of .doc, .docx, and .xlsx files and I'm trying to mine them. They're located in a folder in my working directory called 'files', but I have already encountered an error after simply writing a few lines of code.
The code I have so far is:
library(tm)
library(readtext)
data = readtext('files')
At this point, after waiting for 25 seconds or so, I get the error:
Error: System call to 'antiword' failed (1): The Big Block Depot is damaged
and the code stops running there.
I have tried searching online for solutions but it seems like a fairly rare error and so I only found 1 possible solution at https://github.com/ropensci/antiword/issues/1 but that did not work for me.
This solution suggested that one of my files were corrupt, and suggested using the code
fixInNamespace(antiword, pos="package:antiword")
to change the error to a warning to not interrupt the reading of the files. I tried that, and at first it raised the error of
Error in as.environment(pos):
no item called "package:antiword" on the search list
After which, I loaded the antiword library with a library(antiword) and changed the stop( to a warning(. However, when I ran the data = readtext('files') line again, it immediately raised the error
Error in is_windows() : could not find function "is_windows"
I'm at a loss here! Any help would be appreciated. Should I be using another package in this case?
I had the same problem with my code, where I tried to get a doc. file in R. I also used the readtext library. What helped me was converting the Word documents I was trying to get into R from doc. to docx. When I ran the same code after it worked.

Rjsonio vs jsonlite lexical error

New to this so please excuse any mistakes.
I am using R to convert some JSON files and using JSONLITE is perfect in relation to the format that it produces. However I keep getting a lexical error similar to the below
Error in parse_con(txt, bigint_as_char) :
lexical error: invalid char in json text.
ed that it was delivered to "letterbox" but it wasn't\" ]\n
(right here) ------^
So I decided to use the JSONIO package and there is no lexical error with this package but the format is not as easy to work with.
So suppose I have two questions:
1: Does any one know why the error is produced using Jsonlite and not jsonio
2; is there an easy way to get jsonio to produce outputs like jsonlite?
Thanks
Ibrahim

Resources