【发布时间】:2015-09-03 11:18:33
【问题描述】:
尝试在 ioslides html 演示文稿中使用 knitr 绘制 rgl 3d 绘图时,我的 RStudio 会话崩溃了。有什么办法可以预防吗?
我的块:
```{r setup, results='asis'}
library(knitr)
library(rgl)
knit_hooks$set(webgl = hook_webgl)
```
```{R, testgl, webgl=TRUE, cache=FALSE}
x <- sort(rnorm(1000))
y <- rnorm(1000)
z <- rnorm(1000) + atan2(x,y)
plot3d(x, y, z, col=rainbow(1000))
```
编辑
此错误发生在:
> sessionInfo()
R version 3.2.1 (2015-06-18)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
locale:
[1] LC_COLLATE=English_United Kingdom.1252 LC_CTYPE=English_United Kingdom.1252
[3] LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C
[5] LC_TIME=English_United Kingdom.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] rsconnect_0.4.1.4 htmltools_0.2.6 tools_3.2.1 yaml_2.1.13 rmarkdown_0.7 digest_0.6.8
>
演示的源代码可以在这里找到:
https://github.com/TARF/SMM/tree/master/Presentation
请注意,为了运行代码,需要使用自己的凭据通过 Demography 包连接到 Human Mortality Database。
【问题讨论】: