How to export interactive rgl 3D Plot for publishing or publishing?
I made an interactive 3D plot in R using the rgl package. I would like to be able to send it (and keep it online) to a colleague so she can present it (rotate) in a meeting on her laptop. Is there a way to do this?
Here is the code I used to create the graph:
And this is the plot:
library(rgl)
plot3d(pcaGB$x[,1:3], col=gbMeta2.5K$gbColor, type='s', size=1)
I then use this code to export it to HTML using writeWebGL, but no luck so far:
browseURL(paste("file://", writeWebGL(dir=file.path("~/Documents/", "webGL"), width=700), sep=""))
This is what I get back in the browser window:
I'm also trying to only use writeWebGL, but it creates a folder in the directory with the index.html file, which opens the same image above in the browser.
+3
source to share
1 answer
You can export an interactive graph to html using knitr. For more see: Including an interactive 3D figure with a book .
+2
source to share