My Authors
Read all threads
1. tinytex is a small, powerful alternative to mactex
2. generate Rmds from your R scripts w/ a special syntax for comments: #`
...with knitr::spin
3. knitr::purl translates your .Rmd to .R script! With options for comments translating into code chunks. Or not. Or with full narratives and text.
4. add citations with knitr::write_bib. Great for citing packages! knitr::write_bib(package_name, .bib_file)
5. Cross-ref figures, tables, and sections! In action:
6. inline output of a character vector knitr::combine_words. Defaults to "and". So knitr::combine_words(c("apples", "oranges") becomes "apples and oranges"
And don't forget your oxford commas!
7. line breaks: add 2 spaces at the end of the line. But this can get tedious, so there's an RStudio add-in in blogdown: "quote poem". It adds 2 spaces to each line of the text you've selected. YES
8. put all your code in the appendix rather than the body of your report. Use `ref.label`.
Demo: {r, ref.label=knitr::all_labels() }, along with the setup chunk's knitr::opts_chunk$set(echo=FALSE).
Or, select your choice: {r, ref.label=c('some-code', 'more-code') }
9. Create an animation with `gifski` package and animation.hook='gifski'. Will animate your plots:

yihui.org/en/2018/08/gif…
10. Cache time-consuming code chunks with cache=TRUE. But use wisely, simple tricks can have costs and it might lead to more complications downstream
yihui.org/en/2018/06/cac…
11. Add logos to your R plots with {r, fig.process=function() } to post-process your R code chunk with the magick package.
You can also blur a plot with magick!
Another use of ref.label:: {r, ref.label='earlier-chunk-name' }
OMG I need to play with magick 😍
Woop – analogy of magick and The Force
12. Add real LaTeX math expressions to your R plots. Also using fig.process with dev = 'tikz'. Can be time consuming so a good usecase for cache=TRUE
13. Use other languages: RMarkdown is also really JuliaMarkdown, PythonMarkdown JavaScriptMarkdown, CSSMarkdown... just change the {r} to {python}!

More than 40 languages supported in knitr!!!!
14. Child documents. This is the best! You can knit shorter "child" documents into a "parent" document. A great way to avoid a huge monster document
{r, child='analysis.Rmd'}
15. Start bookdown and blogdown projects. There are different types of gitbooks too. Build book tab, Serve sites.
This has have changed my whole way of thinking about communication and publishing, I use them every day. And Yihui just showed many things I've never heard of!
Ummmm now Yihui is using his camera and facial recognition to make a simulation plot! What! That is amazing!!
Thank you SO much for this webinar @xieyihui and @DahShuInfo!
Missing some Tweet in this thread? You can try to force a refresh.

Enjoying this thread?

Keep Current with JuliaStewart Lowndes

Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

Twitter may remove this content at anytime, convert it as a PDF, save and print for later use!

Try unrolling a thread yourself!

how to unroll video

1) Follow Thread Reader App on Twitter so you can easily mention us!

2) Go to a Twitter thread (series of Tweets by the same owner) and mention us with a keyword "unroll" @threadreaderapp unroll

You can practice here first or read more on our help page!

Follow Us on Twitter!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just three indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!