docker.Rmd 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. ---
  2. title: "Dockerized R Markdown Document"
  3. author: "Nan Xiao"
  4. date: "`r Sys.Date()`"
  5. output:
  6. html_document
  7. liftr:
  8. from: "rocker/r-base:latest"
  9. maintainer: "Nan Xiao"
  10. maintainer_email: "[email protected]"
  11. cranpkg:
  12. - kernlab
  13. extra:
  14. - ADD https://raw.githubusercontent.com/road2stat/liftr/master/inst/docker.Rmd /
  15. - COPY /Users/tengfei/Code/gitrepos/liftr/inst/Dockerfile.Rmd /
  16. ---
  17. ## Spectral clustering example
  18. This is an R Markdown document that could be rendered under a Docker container using `liftr`. The document requires the `specc()` function in the `kernlab` package on CRAN to perform a simple spectral clustering:
  19. ```{r specc, fig.cap = 'Spectral Clustering of Spirals Data'}
  20. library("kernlab")
  21. data(spirals)
  22. sc = specc(spirals, centers = 2)
  23. print(sc)
  24. plot(spirals, col = sc)
  25. ```
  26. ## Options of liftr in this document
  27. The document front-matter metadata includes the options for `liftr`, which is used for dockerizing the document:
  28. ```{r liftrmeta}
  29. rmarkdown::metadata$liftr
  30. ```
  31. ## System and session information
  32. The R session information of the Docker container is shown below.
  33. ```{r session}
  34. sessionInfo()
  35. ```