christophergandrud / networkD3

D3 JavaScript Network Graphs from R
http://christophergandrud.github.io/networkD3
649 stars 270 forks source link

Error: SSL certificate problem - Sankey Diagram #276

Open cebriggs7135 opened 3 years ago

cebriggs7135 commented 3 years ago

Can you please address this issue? I've successfully run the sample code from https://rdrr.io/cran/networkD3/f/README.md up to the Sankey Diagram:

Recreate Bostock Sankey diagram: http://bost.ocks.org/mike/sankey/

Load energy projection data

URL <- paste0("https://cdn.rawgit.com/christophergandrud/networkD3/",

  • "master/JSONdata/energy.json") Energy <- jsonlite::fromJSON(URL) Error in open.connection(con, "rb") : SSL certificate problem: certificate has expired

Plot

sankeyNetwork(Links = Energy$links, Nodes = Energy$nodes, Source = "source",

  • Target = "target", Value = "value", NodeID = "name",
  • units = "TWh", fontSize = 12, nodeWidth = 30) Error in is.factor(Source) : object 'Energy' not found
cjyetman commented 3 years ago

Apparently http://rawgit.com has been shut down. You can access the same dataset directly from this repo at: https://raw.githubusercontent.com/christophergandrud/networkD3/master/JSONdata/energy.json

library(networkD3)
URL <- "https://raw.githubusercontent.com/christophergandrud/networkD3/master/JSONdata/energy.json"
Energy <- jsonlite::fromJSON(URL)
sankeyNetwork(Links = Energy$links, Nodes = Energy$nodes, Source = "source",
              Target = "target", Value = "value", NodeID = "name",
              units = "TWh", fontSize = 12, nodeWidth = 30)
cebriggs7135 commented 3 years ago

Thanks very much.