Statisticians Advancing in R
for Data Science
Marquette University
STAR-DS - SDSS 2026
Tools Used:
git (local)GitHub (remote)RStudio (IDE)Key Terms:
Example: You push your R package to GitHub, allowing your coauthor to edit documentation and submit a pull request.
.exe and install with default optionsbrew install git or Git installerRun this in your Terminal (or Command Prompt):
If this works, Git is installed correctly!
Set your global Git identity:
In RStudio:
A
.gitfolder is created — this is a Git repo!
Your project becomes a real Git repository only after the first commit.
Before the first commit:
main) is not fully establishedusethis::git_sitrep() may failmain branch becomes fully definedThe first commit turns an empty Git repo into a real version-controlled project.
You’ve now authenticated GitHub from R!
Run this in R to create and link a GitHub repo:
This will:
You can now push/pull changes from RStudio Git tab
Use this helpful diagnostic tool:
This tells you:
What each step means:
. . .
“Edit inputs and outputs in function documentation to complete help page for knn_pred()”
Common Mistakes:
Committing everything without checking
Vague messages like “fix” or “updates”
Forgetting to pull before starting work
So far, Git has helped us:
But Git is not just for saving files, but also built for collaboration.
When you contribute to an existing project, you first need a local copy of the repository.
Git branch: a separate “copy” of your project’s code where you can safely make changes without affecting the main version.
Branches let you:
Work on features without breaking main code
Try experiments safely
Collaborate in parallel
mainBranching is helpful because:
Daily workflow:
Pull → Edit → Stage → Commit → Push
For new features:
Branch → Edit → Commit → Push
→ Open Pull Request → Merge
Questions & Discussion