Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

convert examples to use curl package #284

Open
dmenne opened this issue May 28, 2021 · 2 comments
Open

convert examples to use curl package #284

dmenne opened this issue May 28, 2021 · 2 comments

Comments

@dmenne
Copy link

dmenne commented May 28, 2021

windows 10, problem with RCurls and TLS

URL <- "https://raw.githubusercontent.com/christophergandrud/d3Network/sankey/JSONdata/energy.json"
Energy <- RCurl::getURL(URL, ssl.verifypeer = TRUE)

>Error in function (type, msg, asError = TRUE)  : 
  error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version

RCurl::curlVersion()$ssl_version
>> [1] "OpenSSL/1.0.0o"
@cjyetman
Copy link
Collaborator

This is not the repo for RCurl, so if you want that error specifically to be addressed, you'll probably have to report it to the developers of that package.

In order to get examples here working that use RCurl to get the data, you could instead use the more modern pkg curl. For example...

library(curl)
library(jsonlite)
library(networkD3)

URL <- "https://raw.githubusercontent.com/christophergandrud/d3Network/sankey/JSONdata/energy.json"
energy <- fromJSON(curl(URL))

EngLinks <- energy$links
EngNodes <- energy$nodes

sankeyNetwork(Links = EngLinks, Nodes = EngNodes, Source = "source",
              Target = "target", Value = "value", NodeID = "name",
              fontSize = 12, nodeWidth = 30)

@dmenne
Copy link
Author

dmenne commented May 28, 2021

Yes, I know this is not the curl repo, and I got it to work anyway. Just a report for easy correction in your markdown example

@cjyetman cjyetman changed the title Example : sankeyNetword/getURL fails under Windows convert examples to use curl package May 28, 2021
@cjyetman cjyetman reopened this May 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants