create an html file with 3d plot

26 views
Skip to first unread message

Long Vo

unread,
Jun 26, 2017, 1:09:18 AM6/26/17
to knitr
Hi all,
This might be a simple issue, but I'm very new to R and `knitr'
I'm trying to follow the example posted by Yihui here,
and created an Rmd file named "rmarkdown1" (also attached)

```{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))
```
Then use the 'Knit HTML' button in Rstudio. The code compiles and created a 3d plot in R console,
but no HTML file created and an error pops up say:

output file: rmarkdown1.knit.md Error: path for html_dependency not found

Here is my session info:
R version 3.2.4 (2016-03-10) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 7 x64 (build 7601) Service Pack 1 locale: [1] LC_COLLATE=English_Australia.1252 LC_CTYPE=English_Australia.1252 [3] LC_MONETARY=English_Australia.1252 LC_NUMERIC=C [5] LC_TIME=English_Australia.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] shiny_0.14 rmarkdown_1.6 knitr_1.14 [4] extrafont_0.17 MASS_7.3-45 rgl_0.98.1 [7] plot3D_1.1 scatterplot3d_0.3-40 xlsx_0.5.7 [10] xlsxjars_0.6.1 rJava_0.9-8 reshape2_1.4.2 [13] sp_1.2-3 loaded via a namespace (and not attached): [1] Rcpp_0.12.7 plyr_1.8.4 tools_3.2.4 digest_0.6.10 [5] jsonlite_1.1 evaluate_0.9 tibble_1.2 gtable_0.2.0 [9] lattice_0.20-33 yaml_2.1.13 Rttf2pt1_1.3.4 stringr_1.2.0 [13] htmlwidgets_0.7 rprojroot_1.2 grid_3.2.4 R6_2.2.2 [17] ggplot2_2.2.0 extrafontdb_1.0 magrittr_1.5 backports_1.1.0 [21] scales_0.4.1 htmltools_0.3.5 assertthat_0.1 misc3d_0.8-4 [25] mime_0.5 colorspace_1.2-6 xtable_1.8-2 httpuv_1.3.3 [29] stringi_1.1.2 lazyeval_0.2.0 munsell_0.4.3 markdown_0.7.7

Any suggestions are very much appreciated!

Long

rmarkdown1.Rmd
Reply all
Reply to author
Forward
0 new messages