Skip to content Skip to sidebar Skip to footer

Uploading a .csv to R Studio Mac

How to upload your R code on GitHub: example with an R script on MacOS

  • Introduction
  • Prerequisite
  • Step-by-step guide
  • Boosted notes

Introduction

Few days ago, a colleague asked me how to upload some R code on GitHub in club to make information technology attainable to everyone. Due to the lockdown, I could not just go into his office and show him on his computer. So I sent him several screenshots showing, step past step, how to practice so.

Right before I deleted the screenshots I'd merely taken, I idea that perhaps they would be useful for other persons, so I wrote this commodity.

Notation 1: The screenshots have been taken on MacOS and I have not tested it on Windows. Do not hesitate to let me know in the comments whether it is like or not on other operating systems.

Notation 2: There must be other ways to do it, but the method shown beneath is (in my opinion) easy and works well.

Prerequisite

In order to follow this guide and upload your R lawmaking on GitHub, y'all volition need at least:

  • a GitHub business relationship
  • the GitHub Desktop application installed on your computer

Step-by-step guide

For this guide, I employ a R script created to plot the evolution of the hospital admissions due to COVID-nineteen in Belgium. See the repository on GitHub in case you want to run across the final result before proceeding farther.

You oftentimes hear

"A picture is worth a thousand words"

And so here is without further ado how to upload your R script on GitHub in images:

Stride 1: Go to github.com/login and sign in

Stride two: Become to your GitHub profile and create a new repository

Step iii: Gear up the proper name, description, audience and README file for the new repository

Be careful that if yous cull to go far public, it will be visible to everyone. If yous practise not want to share the code, but still want it to be uploaded on GitHub, choose the individual option.

Initializing the repo with a README file is not mandatory, but I strongly recommend it so you lot will be able to add data for this repo.

Step 4: You now run across your new repository with but the README file

Step five: Open the GitHub Desktop application and sign in with your GitHub account

Step 6 a: Clone the repository you only created on github.com to your computer

Step vi b: Clone the repository y'all simply created on github.com to your computer

Pace 6 c: Clone the repository you lot just created on github.com to your computer

Step 7: Your new repo appears on the GitHub Desktop application

Step 8: Open an R script and write your code

(Encounter how to install R and RStudio if you are unfamiliar with it.)

Step 9 a: Relieve your R script in the corresponding folder

You can see the path to the folder in step half-dozen c, under "Local Path".

Step ix b: Salvage your R script in the corresponding binder

Footstep 10: Reopen GitHub Desktop, edit the commit title (1) and click on the commit button (2)

In stride 10, make sure that the electric current repository (meet top left) is the repo you are currently working on.

Step xi: Button the commit to github.com

Step 12: On your GitHub contour, click on the newly created repository

Step 13: You lot now encounter your script which has been added to the repository

Your R code is now available online via the new repository on your GitHub contour. If y'all need to share it, you tin merely share the URL of the repo.

Additional notes

If you need to edit your code:

  1. Find the binder of the repo on your computer by clicking on the button "Show in Finder":

Find the folder of your repo on your computer

  1. You will be redirect to the folder of your repo on your computer. Open the R script you want to work on, edit it and save information technology:

Open the R script, edit it and save information technology

  1. Subsequently your script is saved, practise non forget to commit the changes and push button the commit (see step x higher up).

In case y'all demand to see an sometime version of your code, you can see all commits past clicking on the commits tab accessible via the repo on github.com:

See all commits

Thank you for reading. I promise this article helped you to create a GitHub repository, and upload your R scripts so that it is bachelor to anyone.

As always, if you lot have a question or a proffer related to the topic covered in this article, please add it as a comment so other readers can benefit from the discussion.



Liked this post?

Go updates every time a new article is published.
No spam and unsubscribe anytime.

Share on:

chaseamointair.blogspot.com

Source: https://statsandr.com/blog/how-to-upload-r-code-on-github-example-with-an-r-script-on-mac-os/

Post a Comment for "Uploading a .csv to R Studio Mac"