With the R function `tinytex::latexmk()`, two common LaTeX problems are automatically solved:ġ. They are all too big: TeX Live, MiKTeX, MacTeX (~5Gb). You can also generate a series of plots by yourself without using these packages. Pie(c(i %% 2, 6), col = c('red', 'yellow'),Ĭreating a Pacman-one of the very few legitimate use cases of pie charts! Then use the chunk option `animation.hook='gifski'`: To create a GIF animation from all R plots in a code chunk, install the **gifski** package: Note that this only works for HTML output formats. For other output formats, you get the preview as you save the document. If you are working on **xaringan** slides, you get () of slides. The content of this talk is mostly from this book.Įither call `xaringan::inf_mr()` in RStudio (or click the addin "Infinite Moon Reader"), or explicitly `xaringan::inf_mr('file.Rmd')` outside RStudio. `rmarkdown::render()` = `knitr::knit()` + Pandoc (+ LaTeX for PDF output only). I'll teach you some tricks here so that you can go back and make your friends believe you are able to fight a monster like Ultraman. I press knit, a document appears, and I believe that anything happening in between could be actual magic. > - [Jesse Mostipak Anything about the inner workings of rmarkdown / knitr / pandoc. In the spirit of being vulnerable, what's one thing in R you don't yet quite understand? > Good morning, #rstats friends! I mentioned in class how learning R is a lifelong process, there isn't always a "right" answer, & our community is kind & supportive of beginners. !(resources/media/images/reproducible_analysis/git.Class: center, middle, inverse, title-slide Copy/pasting code errors into search engines !(resources/media/images/reproducible_analysis/knitr_sas.png)Įverything is text so can take advantage through: !(resources/media/images/reproducible_analysis/knitr_engine.png) Objects created in a code chunk are available to code in later chunks Document is ran in a fresh R session using knitr, therefore all libraries used should be loaded *within the document*Ģ. Render at the command line with set parametersġ. Render at the command line with the default YAML options Welcome to this workshop, given at Southern Brewing on June 25, 2019. Welcome to this workshop, given at `r params$location` on `r params$date`. !(resources/media/images/reproducible_analysis/param_params.png) !(resources/media/images/reproducible_analysis/param_yaml2.png) !(resources/media/images/reproducible_analysis/param_yaml1.png) center(resources/media/images/reproducible_analysis/knitr_pandoc.png)] !(resources/media/images/reproducible_analysis/md_chunk_fig.png) !(resources/media/images/reproducible_analysis/md_chunk_include.png) !(resources/media/images/reproducible_analysis/md_chunk_eval.png) !(resources/media/images/reproducible_analysis/md_chunk_echo.png) !(resources/media/images/reproducible_analysis/md_chunk_options.png) When the report is rendered, R Markdown will evaluate the code and include the results, while also removing the backticks and braces. !(resources/media/images/reproducible_analysis/md_chunk.png) Insert a "chunk" of R code using backticks and braces. R Markdown will replace the code with its results.įor example, ` `r 87 + 78` ` will evaluate to 165 Place code within a sentence with ` `r *code here*` `. !(resources/media/images/reproducible_analysis/md_equations.png) !(resources/media/images/reproducible_analysis/md_expressions.png) !(resources/media/images/reproducible_analysis/md_images.png) !(resources/media/images/reproducible_analysis/md_links.png) !(resources/media/images/reproducible_analysis/md_lists.png) !(resources/media/images/reproducible_analysis/md_text.png) Multiple #'s create lower level headers](resources/media/images/reproducible_analysis/md_headers.png) Perfect for reports where styling does not change a lot (annual reports) Combine the content creation and styling R Markdown document, means all the advantages are available Uses Paged.js polyfill to implement CSS support Paginated HTML with R Markdown: ()Ĭurrent templates include () right-column(resources/media/blogdown.JPG)]()] !(resources/media/overview_cover.jpg#fit) Versus having to reconstruct figures and tables, paste them into a Word document, and further hand-edit various detailed results. Reproducible documents: If error discovered, or if additional data, can just re-compile the report and get new or corrected results. !(resources/media/rmarkdown.JPG#fit-more) !(resources/media/images/report.jpg#smallest) !(resources/media/images/graphics.jpg#smallest) !(resources/media/images/analyze.jpg#smallest) !(resources/media/images/query.jpg#smallest) !(resources/media/images/reproducible_analysis/md_rmarkdown.png) Manager, Data Analysis - AACSB International Class: center, middle, inverse, title-slide
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |