liftr-minimal.Rmd 1018 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. ---
  2. title: "A Minimal Example for liftr"
  3. author: "Nan Xiao <<[email protected]>>"
  4. date: "`r Sys.Date()`"
  5. output:
  6. tufte::tufte_html: default
  7. liftr:
  8. from: "rocker/r-base:latest"
  9. maintainer: "Nan Xiao"
  10. email: "[email protected]"
  11. cran:
  12. - tufte
  13. - kernlab
  14. ---
  15. ## A spectral clustering example
  16. 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 from CRAN to perform a simple spectral clustering:
  17. ```{r specc, fig.cap = 'Spectral clustering of spirals data.'}
  18. library("kernlab")
  19. data(spirals)
  20. set.seed(42)
  21. sc = specc(spirals, centers = 2)
  22. print(sc)
  23. plot(spirals, col = sc)
  24. ```
  25. ## Options of liftr in this document
  26. The document front-matter metadata includes the options for `liftr`, which is used for dockerizing the document:
  27. ```{r liftrmeta}
  28. rmarkdown::metadata$liftr
  29. ```
  30. ## Session information
  31. The R session information for compiling this document is shown below.
  32. ```{r session}
  33. sessionInfo()
  34. ```