RStudio

First R and RStudio must be installed on your machine. Just as with Git, if you work within NHS National Services Scotland these can be requested through the Service Portal. Once authorised, this will allow you to download it from the Software Center on your machine. You may also be able to use the server versions of RStudio and the project workflow will be the same.

  1. Once in RStudio, go to Tools in the menu bar > Global Options > Git/SVN:

 

  1. If “Git executable:” shows “(none)”, click “Browse” and select the Git executable installed on your system. - On Windows, the filepath should point to folder Git was installed to and finish .../bin/git.exe. If you’re on the server, it should be /usr/bin/git. That’s it for attaching RStudio and Git. This will allow you to utilise the RStudio Git GUI tools inside R Projects.

  2. Create an SSH Key - this step is recommended for users who will be using a remote such as GitHub with their project. The other option is HTTPS (which doesn’t require setup), however SSH is a faster and more convienent method of connecting to GitHub.

    1. If you see anything within the ‘SSH RSA Key:’ box, you can skip this step, else click on ‘Create RSA Key…’, click ‘Create’ and close the dialog box that appears confirming the key creation. If this doesn’t work, there may be access/priviledge issues which will need to be resolved through IT and logging a ticket through the Service Portal.
    2. Now, click on ‘View public key’ and copy the text string that appears in a dialog box.
    3. Go to your GitHub SSH Settings and click ‘New SSH key’.
    4. Give the key a meaningful title that you will recongnise and paste the key from RStudio. Complete the process by clicking ‘Add SSH key’.