r-for-research

R for Research: Introduction to good practices

These materials were developed for an LSHTM workshop introducing good practices using R for research. The workshop includes:

Theme Content Key tools
Project set up Reproducibility: RStudio projects
Modularity: separating data, code, and reporting
Documentation: READMEs and dependencies
RStudio Projects
renv
Writing code Code style guidelines
Writing, testing, and getting help
Refactoring: managing existing code
lintr
stylr
Communicating & collaborating Reporting with Rmarkdown
Collaboration with Github
Rmarkdown
Github

Workshop content draws on:

Workshop materials

Learning more

General resources

Most of these resources cover the key topics of the session (workflow, style guidance, R Markdown, and Git). If one doesn’t make sense to you, try another for a different explanation.

Setting up RStudio Projects

Coding

Reporting and collaborating

Questions & resources