12 Final Workflow
Abstract
    This section outlines a workflow built from the best practices and tools outlined in this training.
  12.1 Final Workflow
We’ve learned many best practices and explored a lot of tools. How can we put it all together into a sustainable workflow?
12.1.1 Setup
- Create a folder for your project.
- Add any project-relevant materials you already have (e.g. that data someone emailed to you and that paper that that inspired the project).
 
- Optional: Create a Zotero library or group for relevant literature
- Create a .Rproj
- Create a README
- inita local Git repository
- addand- committhe .Rproj and README
- Create a remote GitHub repository with the same name as the folder. Connect the local and remote repositories using the instruction on GitHub.
- Initialize a virtual environment with library(renv).
12.1.2 Analysis Development
- Create GitHub issues that organize progress on your work.
- For each issue, checkout a branch with the name iss<number>.
- Develop your analysis
- Use Quarto. Render early and often.
- Regularly commit and push changes to GitHub.
- Keep your renv up-to-date.
- Adopt defensive programming techniques like modular, well-tested code and assertions.
 
- When you think you’ve addressed an issue, open a pull request from iss<number>tomainand flag someone as a reviewer.
- Close the issue when the PR is approved and merged into main.
12.1.3 Closing Up a Project
- Ensure that all Quarto documents have been rendered with the most up-to-date .qmddocuments.
- Ensure that renvreflects the software layer of the computing environment.
- Ensure that all local changes have been pushed to the GitHub repository.
- Ensure all necessary branches have been merged into main.
- Update the README with instructions for how to reproduce the analysis.
- Consider building a GitHub page for your analysis.