How to Upload Code in Github on Mac
How to upload your R code on GitHub: instance with an R script on MacOS
See a step-by-pace guide (with screenshots) on how to create a GitHub repository and upload R code and scripts using GitHub desktop
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:
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.
(Encounter how to install R and RStudio if you are unfamiliar with information technology.)
You tin come across the path to the folder in step half dozen c, nether "Local Path".
In step ten, make certain that the current repository (see meridian left) is the repo you are currently working on.
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:
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:
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
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