Using Windows 10, Rstudio 1.2.5001, R 3.6.1 , htmlwidgets 1.5.1, rgl 0.100.30, knitr 1.25
I am having the same problem as this user - i.e. if I knit an RGL plot it just leaves a white gap and does not display (their issue was closed recently but I dont think a solution was presented??)
Hi,
I am the user in your referred post. I eventually made it work with Rstudio 1.1,
I have tried couple of weeks trying to find solution to Rstudio 1.2 but with no luck, I wish you can find the solution.
On some systems, RStudio doesn't enable WebGL, so it can't display rgl scenes in the internal browser. See https://github.com/rstudio/rstudio/issues/5678. If you look at those HTML files in an external browser like Firefox or Chrome, you'll see the rgl output. I have a system like that, and can't see output from @lepovas's suggested fix in RStudio, but I can in Firefox.
As well, sometimes it is producing files where the rgl output isn't visible anywhere. I'm trying to track down what's going wrong with these. A workaround that seems to fix this is to run options(rgl.useNULL=TRUE) before library(rgl). That's usually a good idea to include because it prevents lots of popup windows during knitting, but it shouldn't be necessary.