[R Course] How to: Connect Nüance-R to GitHub

R Courses

Integrate GitHub into your daily work with R and R Markdown.

Thierry Warin https://warin.ca/aboutme.html (HEC Montréal and CIRANO (Canada))https://www.hec.ca/en/profs/thierry.warin.html
06-11-2019


Nüance-R makes it easy for you to connect your documents to GitHub. [@bryan_happy_2019] Take a look at this course!

Create a GitHub account

Create an account on https://github.com, it’s free!

Or, if you already have one, go to the next step.

Create a GitHub repository

Make sure you are logged in on GitHub.

Click on the green “New repository” button. Or, if you are on your own profile page, click on “Repositories”, then click on the green “New” button.

How to fill this in:

Click on the green button “Create repository.”

Copy the HTTPS clone URL to your clipboard via the green “Clone or Download” button.

Connect GitHub on RStudio

In RStudio, start a new Project:

File > New Project > Version Control > Git.

In “Repository URL”, paste the URL of your new GitHub repository. It will be something like this https://github.com/jennybc/myrepo.git.

Accept the default project directory name, e.g. myrepo, which coincides with the GitHub repo name.

Take charge of – or at least notice! – where the Project will be saved locally. A common rookie mistake is to have no idea where you are saving files or what your working directory is. Pay attention. Be intentional.

Click “Create Project”.

You should find yourself in a new local RStudio Project that represents the new test repo we just created on GitHub. This should download the README.md file from GitHub. Look in RStudio’s file browser pane for the README.md file.

Change, Save, Commit

From RStudio, modify the README.md file, e.g., by adding the line “This is a line from RStudio”. Save your changes.

Commit these changes to your local repo. How?

From RStudio:

Click the “Git” tab in upper right pane. Check “Staged” box for README.md. If you’re not already in the Git pop-up, click “Commit”. Type a message in “Commit message”, such as “Commit from RStudio”. Click “Commit”.

Push to GitHub

Click the green “Push” button to send your local changes to GitHub. If you are challenged for username and password, provide them (but see below). You should see some message along these lines.

[master dc671f0] blah
 3 files changed, 22 insertions(+)
 create mode 100644 .gitignore
 create mode 100644 myrepo.Rproj

Confirm the local change propagated to the GitHub remote. Go to the browser on your new GitHub repo page.

Refresh.

You should see the new “This is a line from RStudio” in the README.

If you click on “commits”, you should see one with the message “Commit from RStudio”.

If you have made it this far, you are DONE with set up.



Citation

For attribution, please cite this work as

Warin (2019, June 11). www.warin.ca: [R Course] How to: Connect Nüance-R to GitHub. Retrieved from https://warin.ca/posts/rcourse-howto-connectnuancertogithub/

BibTeX citation

@misc{warin2019[r,
  author = {Warin, Thierry},
  title = {www.warin.ca: [R Course] How to: Connect Nüance-R to GitHub},
  url = {https://warin.ca/posts/rcourse-howto-connectnuancertogithub/},
  year = {2019}
}