, 10 tweets, 2 min read Read on Twitter
Sharing @JennyBryan's deep thoughts (aka pro tips) from "What they forgot to teach you about R" workshop at #rstudioconf.
1. Be organized.
- Future you and others will thank you!
- Make sure the projects can explain themselves by using “wordy” and “needs” words
- Set up a clear structure for the sub-folders: (e.g. data, fig, syntax)
- README is great but it depends on how well it is maintained
2. Adopt a project oriented workflow
- You can work on more than one things at time
- You can easily share, reproduce and collaborate.
- Having a separate RProject for each project will keep everything contained and again organized!
3. Practice “Safe paths”
- Don’t use file paths as strings. (e.g using paste or strsplit to combine file paths)
Instead install fs (file path handling) and here packages.
- The here package is designed to work inside a project. It helps build paths within a RProject.
3. Practice "Safe Paths" (Continued)
- This is particularly useful if you work in team...each team member does not have to manually edit file paths.
4. Names matter! (1/2)
Files names matter. It must be
- machine readable: no white space, punctuation, accented characters, case sensitivity, generally exclude any weird characters
- human readable: easy to understand, name contains info on file content and context
4. Names matter! (2/2)
- Lastly, it must sort nicely: computer automatically sorts files names - don’t fight against its nature.
5. Break logic and output separately. (1/2)
- Pulling data processing steps apart so it’s clean and easy to follow-up.
- Create separate files for different processes: reading_data, wrangling_data, modelling, make_figs, etc
- Sketch out the purpose of each script (see pictures)
5. Break logic and output separately. (2/2)
- Create a final and separate controller script that runs all of the files (e.g. like dominos)
6. Important: always restart your R session between scripts!! You should self-contained R scripts for a smooth ride forward.
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 Birunda Chelliah
Profile picture

Get real-time email alerts when new unrolls (>4 tweets) 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!

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!