Using knitr
it is possible to embed a rgl
3D graphics in a html document from a Rmarkdown
source file:
```{r setup}
li
I added a new hook hook_webgl()
in knitr, which was incorporated into rgl later. Here is an example:
```{r setup}
library(knitr)
library(rgl)
knit_hooks$set(webgl = hook_webgl)
```
```{r testgl, webgl=TRUE}
x <- sort(rnorm(1000))
y <- rnorm(1000)
z <- rnorm(1000) + atan2(x,y)
plot3d(x, y, z, col=rainbow(1000))
```