Recent advances in the difference-in-differences literature. An attempt at understanding via simulations.
You need GIT installed and talking to RStudio. See
here for help.
You need a working version of Latex + Editor (I use
TexStudio) or figure out how to do it in
RMarkdown (like so).
Keep options etc. in the RProfile file.
- Commit and pull/push through RStudio.
- Create new branch (on local and remote) via RStudio. Make sure to commit changes to the correct branch and push before switching branches.
- Merge branch to main via shell (git merge –no-f nameofbranch), shell asks for commit message but can just close and commit via RStudio.
- Delete branches on local (git branch -d nameofbranch) and on remote (git push origin –delete nameofbranch)
- Update branch list from remote with git fetch -p
- data does not get uploaded (hence, folder included in .gitignore file)
Renv is used to create sandboxed package versions that will be transferable between machines. - Intitialize with (should automatically execute when cloning this repository). - With a new repo, first to load the package status of the (clean) renv.lock file. - When new packages are installed or updated, save the current status with in the renv.lock file.
- Changes in latex docs should be commited to git via RStudio.
- Include auxiliary latex files in gitignore.
- GranttMcDermott uses GNU Make to automatically run all (or parts of) the executables in the project. Looks cool but I will stick with the one master.R file for now which executes all the code.
This workflow was inspired by Grant McDermott’s Git
Lecture
and exemplary Git
Repository.
Info about Git and RStudio comes from
happy-git-with-R.
Info about Renv from the package
documentation.