r2d3 icon indicating copy to clipboard operation
r2d3 copied to clipboard

Example of 0.2.2 barchart is not found

Open chriswiduta opened this issue 6 years ago • 2 comments

Im getting an error running the example from https://rstudio.github.io/r2d3/: r2d3(data=c(0.3, 0.6, 0.8, 0.95, 0.40, 0.20), script = "barchart.js")

Error: barchart is not defined ReferenceError: barchart is not defined

The above code was found straight from the docs. I did however have a r2d3 0.2 installed on a second computer. Running the following still works and displays the demo graph.
r2d3(data=c(0.3, 0.6, 0.8, 0.95, 0.40, 0.20), script = system.file("examples/barchart.js", package = "r2d3"))

chriswiduta avatar Jun 15 '18 18:06 chriswiduta

@chriswiduta right, we thought it was more clear to show only script = "barchart.js" since it assumes you will have to create your own script, but as you point out, system.file("examples/barchart.js", package = "r2d3") would be the correct way of running this example.

If we get more feedback than script = "barchart.js" is confusing, we can change this in the docs. I'll leave this issue open for a bit longer before making a change.

javierluraschi avatar Jun 18 '18 10:06 javierluraschi

I'm having the same issue as above. Running with the 2nd script works fine.

freshforlife avatar Mar 27 '19 20:03 freshforlife