Once you get the hang of using Projects in RStudio, you may be inclined to collaborate with others on the same project. If so, you will want to set up a Project that links directly to GitHub. By having your project on GitHub (and regularly saving it / updating it on GitHub), your collaborators will always have access to the most up to date analysis information.
If you have already become familiar with using Projects in RStudio and GitHub with collaborative projects, then putting them together is a matter of opening the project in RStudio by cloning the Git repository. If you have not yet set Git up within your RStudio IDE, your best strategy for problem solving is Jenny Bryan’s Happy Git and GitHub for the useR website, https://happygitwithr.com/
Working with GitHub in R
After your project is cloned from GitHub into the RStudio IDE, you should find the Git command interface (usually) in the top right corner of your RStudio IDE. From there, you can pull, commit, and push. You will also have the ability to investigate the diff files and stage/unstage etc.
Teaching with GitHub in R
Amidst numerous data science topics in this blog you’ve been exposed to the wonders of the tidyverse, R Markdown, projects in RStudio, and GitHub. All of these tools enable a more productive and reproducible data science workflow. Not only are they skills and tools that students will be working with on the job, but they provide students better engagement with data science topics while in school. To wit, all of these technologies should be used in unison as an integrated part of the classroom experience.
GitHub is the perfect place to host course materials so that students can easily pull what they need and contribute their work as needed via objects like R Markdown documents within projects.
It should be noted that not all Git operations can be done within the RStudio interface (e.g. git stash), but the list of resources below will be a great first step towards learning what can be done.
Jenny Bryan’s Happy Git and GitHub for the useR: https://happygitwithr.com/ (a must read for all R users who are new to Git)
Jenny Bryan’s package
usethis“facilitates interactive workflows for R project creation and development.” https://www.tidyverse.org/articles/2019/04/usethis-1.5.0/
Emily Riederer’s streamlined process for interfacing R Projects and GitHub https://emilyriederer.github.io/projmgr/, and associated blog about the work: https://emilyriederer.netlify.com/post/rmarkdown-driven-development/ .
About this blog
Each day during the summer of 2019 we intend to add a new entry to this blog on a given topic of interest to educators teaching data science and statistics courses. Each entry is intended to provide a short overview of why it is interesting and how it can be applied to teaching. We anticipate that these introductory pieces can be digested daily in 20 or 30 minute chunks that will leave you in a position to decide whether to explore more or integrate the material into your own classes. By following along for the summer, we hope that you will develop a clearer sense for the fast moving landscape of data science. Sign up for emails at https://groups.google.com/forum/#!forum/teach-data-science (you must be logged into Google to sign up).
We always welcome comments on entries and suggestions for new ones.