How to Upload Code in Github on Mac

See a step-by-pace guide (with screenshots) on how to create a GitHub repository and upload R code and scripts using GitHub desktop

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

Introduction

Few days ago, a colleague asked me how to upload some R code on GitHub in order to make it attainable to everyone. Due to the lockdown, I could not just get into his part and show him on his calculator. So I sent him several screenshots showing, footstep by step, how to exercise so.

Right before I deleted the screenshots I'd simply taken, I idea that peradventure they would be useful for other persons, so I wrote this article.

Note 1: The screenshots have been taken on MacOS and I take not tested information technology on Windows. Do not hesitate to allow me know in the comments whether it is similar or non on other operating systems.

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

Prerequisite

In club to follow this guide and upload your R code on GitHub, you volition need at least:

  • a GitHub account
  • the GitHub Desktop application installed on your computer

Pace-by-stride guide

For this guide, I utilise a R script created to plot the evolution of the hospital admissions due to COVID-xix in Belgium. See the repository on GitHub in instance you want to see the final result before proceeding further.

You often hear

"A flick is worth a thousand words"

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

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

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

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

Step ii: Get to your GitHub profile and create a new repository

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

Step 3: Prepare the proper name, description, audience and README file for the new repository

Exist careful that if you choose to make information technology public, it will be visible to everyone. If yous do not want to share the code, just nonetheless desire information technology to be uploaded on GitHub, choose the individual option.

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

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

Stride 4: Y'all now see your new repository with but the README file

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

Step 5: Open up the GitHub Desktop awarding and sign in with your GitHub account

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

Step vi a: Clone the repository yous just created on github.com to your computer

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

Pace vi b: Clone the repository you just created on github.com to your computer

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

Step half-dozen c: Clone the repository y'all just created on github.com to your calculator

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

Stride 7: Your new repo appears on the GitHub Desktop awarding

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

Stride 8: Open an R script and write your lawmaking

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

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

Footstep ix a: Save your R script in the respective folder

You tin come across the path to the folder in step half dozen c, nether "Local Path".

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

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

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

Step ten: Reopen GitHub Desktop, edit the commit championship (1) and click on the commit button (2)

In step ten, make certain that the current repository (see meridian left) is the repo you are currently working on.

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

Step 11: Push the commit to github.com

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

Pace 12: On your GitHub profile, click on the newly created repository

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

Stride 13: You now see your script which has been added to the repository

Your R lawmaking is now bachelor online via the new repository on your GitHub profile. If you need to share it, y'all can simply share the URL of the repo.

Additional notes

If you need to edit your code:

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

Locate the folder of the repo on your reckoner, open the R script, edit it and save it

Subsequently your script is saved, practice non forget to commit the changes and button the commit (see step 10 above).

In example you need to see an onetime version of your code, you can see all commits past clicking on the commits tab attainable via the repo on github.com:

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

See all commits

Thank you for reading. I hope this article helped you to create a GitHub repository, and upload your R scripts so that information technology is available to anyone.

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

Related manufactures

  • Ane-proportion and goodness of fit exam (in R and by mitt)
  • How to create a uncomplicated Coronavirus dashboard specific to your country in R
  • How to perform a one sample t-test by mitt and in R: exam on one mean
  • The 9 concepts and formulas in probability that every information scientist should know
  • Getting started in R markdown

coopernoppy1967.blogspot.com

Source: https://towardsdatascience.com/how-to-upload-your-r-code-on-github-example-with-an-r-script-on-macos-3205d8d0d60

0 Response to "How to Upload Code in Github on Mac"

Postar um comentário

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel