0

Hi I'm using RJSONIO in Windows and when I perform the following it works fine:

library(RJSONIO)    
fromJSON("https://issues.apache.org/jira/rest/api/2/project")

It returns a JSON but when I do the same thing in Linux I get the following error:

Error in file(con, "r") : cannot open the connection

after doing some search on Google I noticed I needed to mention "file=" fromJSON(file="https://issues.apache.org/jira/rest/api/2/project")

so now I get the error:

unable to find an inherited method for function âfromJSONâ for signature â"missing", "missing"â

Any suggests ?

codeBarer
  • 2,238
  • 7
  • 44
  • 75
  • What versions are you using on both machines? You can do `installed.packages()["RJSONIO", "Version"]` to find out. – flodel Apr 19 '14 at 11:22

1 Answers1

2

That is explained in ?url: http:// URLs work exactly like files everywhere, but https:// URLs do not.

Note that the https:// URL scheme is not supported except on Windows. There it is only supported if --internet2 or setInternet2(TRUE) was used (to make use of Internet Explorer internals), and then only if the certificate is considered to be valid. With that option only, the http://user:pass@site notation for sites requiring authentication is also accepted.

You can explicitly use RCurl:

fromJSON(RCurl::getURL("https://issues.apache.org/jira/rest/api/2/project"))
Vincent Zoonekynd
  • 31,893
  • 5
  • 69
  • 78