문제

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 ?

도움이 되었습니까?

해결책

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"))
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top