In the spirit of #EpiWritingChallenge, I thought I'd share some elements of my writing workflow in Rstudio and R Markdown. I'm changing this all the time and would love to hear about yours! You can find this example on my GH here: github.com/malcolmbarrett… #rstats 1/8
The best thing about markdown is the way you can intermingle text with code, but I often find I need to focus on the words. The first step for me is to zoom to the the source pane using ctrl-shift-1 #rstats 2/8
Then, I collapse everything using the fold fall keyboard shortcut, which is opt+cmd+o on Mac and alt+o on Windows. I only unfold the section I want to work on and focus on that #rstats 3/8
A killer feature of R Markdown is the way it formats citations. To use it, you need a .bib file for references and .csl file for journal formats. You can export .bib files from Zotero or other software. Put the file in the YAML as `bibliography: myfile.bib` #rstats 4/8
There's a repo of csl files for many different journals here: github.com/citation-style…. You can also use the @rOpenSci seasl package github.com/ropenscilabs/s…. Use `get_styles()` to download them, then add the csl file to YAML: csl: "`r seasl::styles('my-journal')`"
#rstats 5/8
When you have your .bib and .csl files set up, the citr package makes it easy to search and insert citations with an add-in app. I set my keyboard shortcut to launch the citr app with cmd+R #rstats 6/8
One of the benefits of using seasl is that you can easily change the journal to match the citation formatting style you need *cough*submitting somewhere else*cough*. #rstats 7/8
Other things that I've found useful in this workflow is to use the Zotero Chrome extension with a Google Scholar shortcut while logged in to my university library. You can find a nice walkthrough on that here: github.com/bbest/rmarkdow… #rstats 8/8
If you have Better BibTeX for Zotero installed (retorque.re/zotero-better-…), citr will automatically assemble your bib file for you as `references.bib`, so you don't need to export it! Thanks @AuthorCarpentry and @adam42smith!
Missing some Tweet in this thread?
You can try to force a refresh.

Like this thread? Get email updates or save it to PDF!

Subscribe to Malcolm Barrett 🦃+👨‍🎤
Profile picture

Get real-time email alerts when new unrolls are available from this author!

This content 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!

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 and get exclusive features!

Premium member ($30.00/year)

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!