R 3.2.2: “rjson” and “RJSONIO” package installed,

2019-08-30 10:13发布

问题:

I've been having a lot of trouble using the "fromJSON" command. I'm trying to collect instagram data using their API, and this command isn't working. I'm using R and I have both packages for converting JSON to R installed, but I keep getting the following error: Error: could not find function "fromJSON"

I use R Studio and R 3.2.2 for Windows 8 x64. I tried searching and couldn't find a solution. Any help would be appreciated.

回答1:

Installing the package alone doesn't suffice. You need to load the library too... Use library(rjson) or library(RJSONIO) or ... depending on which package you prefer, before calling any functions in it.



回答2:

If you just installed the package, try rjson::fromJSON() instead of just fromJSON()