Innovation R

Learn to Connect RStudio to GitHub in Under Five minutes

In Microsoft, we trust.

Since Microsoft’s acquisition of GitHub for $7.5 million USD, there’s been a mixed bag of emotions in regards to Microsoft’s access-to-information inside private repositories.

Some have pointed out GitHub’s acquisition was necessary as the service would eventually need to make changes to their pricing structure to keep afloat — Microsoft alleviates this.

Meanwhile, others are fleeing to GitLab and other repository services since they value a decentralized platform. The irony being GitLab currently uses Microsoft Azure.

So is this knee-jerk reaction even necessary? I see hackers licking their lips at all that data being hastily transferred by non-experts and  can cause a lot more problems for a company instead. There is absolutely value in a decentralized platform and GitLab and the like do provide self-hosted repositories. Be sure you know what you’re doing!

If you have chosen to stay with GitHub here’s how you can set up.

Start the timer!

Create a Github account, if you don’t already have one click here

1) Create a new repository on Github

1_1

2) Choose a repository name – you have the option to initialize the repository with a readme.txt or not. It is always good practice to have a readme file explaining your code so I strongly recommend you do!

2

3) Copy the address from the [Clone or download] button

3_3

4) Open Rstudio and create a new project and choose the last option ‘Version Control’

 

5) Paste the Github address you copied earlier and name your project

6

Bam, you are linked up just like that!

Troubleshoot: If you get an error and require to download Git, you can do so here and simply use the default installation, then restart R Studio.

Test Commits

Let’s create a new R script and name it ‘cd.’ I wrote an easy code (c <- 10+2) in cd and saved my file. Then, click on git button on the top right corner. Check the script name you want to push and click the commit button.

 

Write a commit message and click push button

9_9

You’ll be prompted to sign into your Github account, do so.

11_11

Now go back to Github and reload your page. Click the script and you will see your code.

12_12

13

It’s as simple as that!

Let us know your thoughts on Microsoft’s GitHub acquisition in the comments or tweet us @DataCritics

0 comments on “Learn to Connect RStudio to GitHub in Under Five minutes

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: