How to Upload a Picture to Github File
How to upload your R code on GitHub: case with an R script on MacOS
- Introduction
- Prerequisite
- Step-by-stride guide
- Additional notes
Introduction
Few days ago, a colleague asked me how to upload some R code on GitHub in social club to make it accessible to everyone. Due to the lockdown, I could non simply go into his office and show him on his computer. So I sent him several screenshots showing, step by step, how to do so.
Right before I deleted the screenshots I'd simply taken, I thought that possibly they would be useful for other persons, so I wrote this article.
Notation 1: The screenshots have been taken on MacOS and I have non tested it on Windows. Do non hesitate to let me know in the comments whether it is like or not on other operating systems.
Annotation 2: In that location must be other ways to practise information technology, but the method shown below is (in my opinion) easy and works well.
Prerequisite
In lodge to follow this guide and upload your R code on GitHub, you volition need at least:
- a GitHub business relationship
- the GitHub Desktop application installed on your computer
Stride-by-step guide
For this guide, I utilise a R script created to plot the development of the infirmary admissions due to COVID-19 in Belgium. Meet the repository on GitHub in case you want to see the final result before proceeding further.
You oftentimes hear
"A picture is worth a thousand words"
And so here is without farther ado how to upload your R script on GitHub in images:
Be careful that if you choose to brand information technology public, information technology volition be visible to everyone. If you do not desire to share the lawmaking, simply withal desire it to be uploaded on GitHub, cull the individual option.
Initializing the repo with a README file is not mandatory, only I strongly recommend it so you lot will be able to add information for this repo.
(See how to install R and RStudio if you are unfamiliar with it.)
You tin can see the path to the folder in pace vi c, under "Local Path".
In footstep 10, make sure that the current repository (see tiptop left) is the repo you are currently working on.
Your R code is now available online via the new repository on your GitHub profile. If you need to share it, y'all tin simply share the URL of the repo.
Boosted notes
If you need to edit your lawmaking:
- Find the folder of the repo on your computer by clicking on the button "Show in Finder":
- You will exist redirect to the binder of your repo on your computer. Open the R script you desire to work on, edit it and relieve it:
- After your script is saved, practice non forget to commit the changes and push the commit (meet step ten above).
In case you need to see an old version of your lawmaking, you can see all commits by clicking on the commits tab accessible via the repo on github.com:
Thanks for reading. I hope this commodity helped y'all to create a GitHub repository, and upload your R scripts so that it is bachelor to anyone.
As always, if you have a question or a suggestion related to the topic covered in this article, please add it equally a comment so other readers can benefit from the discussion.
Liked this post?
Get updates every fourth dimension a new article is published.
No spam and unsubscribe anytime.
Share on:
Source: https://statsandr.com/blog/how-to-upload-r-code-on-github-example-with-an-r-script-on-mac-os/
0 Response to "How to Upload a Picture to Github File"
Post a Comment