6 R Coding Practices
This chapter has moved to Principles of Scientific Computing, the Morrison Lab’s general-purpose guide to coding for research projects: R Coding Practices (source: https://github.com/Morrison-Lab/psc).
That page covers:
- Lab Protocols for Code and Data
- The Tool-Building Mindset
- Essential R Package Development Tools
- Complete Package Development Workflow
- Organizing scripts
- Testing Requirements
- Test-Driven Development
- Benchmarking
- Iterative Operations
- Reading and Saving Data
- Version Control and Collaboration
- Quality Assurance Checklist
- Automated Code Styling
- Documenting your code
- Design Documentation with ADRs
- Object naming
- Function calls
- Function decomposition
- One function per file
- Function length limits
- Keep It Short and Simple (KISS)
- Decomposing Code Chunks in Quarto Documents
- The here package
- Reading/Saving Data
- Integrating Box and Dropbox
- r-lib Packages
- Tidyverse
- Coding with R and Python
- Repeating analyses with different variations
- Reviewing Code
- Getting Help with Code
- Additional Resources
NoteLooking for a specific section that used to be here?
This chapter’s old section anchors still resolve on this page, so old bookmarks and links land here, but the content now lives on the page linked above, under the same anchor. For example, #sec-foo here is chapters/coding-practices.html#sec-foo on the psc site.