Github
in Rstudio
In this exercise, each participant will fork a github repo, and contribute a file required to simulate the evolutionary trajectory of an imaginary species’ body size.
We’ll use github to collate all species files and plot them all up together at the end! We’ll also discover the skull and beak shapes associated with each simulated species size.
can be overwhelming
demands for increased openness, transparency & reproducibility
push to harness the power of the internet
can be extremely powerful
- ideal for managing the full suite of research outputs such as datasets, statistical code, figures, lab notes, and manuscripts.
- supports peer review, commenting, and discussion.
- Diverse range of efforts, from individual to large bioinformatics projects, laboratory repositories, as well as global collaborations have found a home on GitHub
♡
>
centralising information e.g. weecology / “Nine simple ways to make it easier to (re)use your data” paper
Beak and skull shapes in birds of prey (“raptors”) are strongly coupled and largely controlled by size.
In this exercise, each participant will fork a github repo, and contribute a file required to simulate the evolutionary trajectory of an imaginary species’ body size.
We’ll use github to collate all species files and plot them all up together at the end! We’ll also discover the skull and beak shapes associated with each simulated species size.
We’ve initiated our project as a github repository but not connected it to remote repository on GitHub
In the Evolottery exercise we used a method of linking to a repository by cloning one that already exists on GitHub. Now we want to do the opposite.
usethis::use_github(protocol = "https")
(Works with GITHUB_PAT)
if for some reason it creates the repository on GitHub but doesn’t push the contents, try running git push origin master
in the terminal/shell
If you create the github reporsitory with ssh authentication (use_github()
default), you can:
Change to https authentication :
git remote set-url origin https://github.com/USERNAME/REPOSITORY.git
Check what authentication you are using by running this in the terminal
git remote -v
https: origin https://github.com/USERNAME/REPOSITORY.git (fetch)
ssh: origin git@github.com:USERNAME/REPOSITORY.git (push)
More details here
There are two very important documents missing in our repository
Let’s go create an issue in our repository about this.
READMEs are the landing page of any repository on GitHub.
usethis::use_readme_md()
Creates a simple md
README
usethis::use_readme_rmd()
Creates an Rmd
README in which you can run R examples and automatically creates the README.md
. - Render each time you make changes to README.Rmd
so README.md
is updated.
usethis::use_mit_license("Anna Krystalli")
#
in a commit message to link it to that specific issue.eg add README & LICENSE. Fix #1
Commit all these files that you just created, referencing issue 1 (#1
) in your commit message.
Push to GitHub
Check out the issue to se what happened.
(N.B if you use the phrase resolve #1, GitHub will also close the issue 👍)
If you haven’t already published the rendered (.html
) version of your report do so now.
Head to GitHub and look for the Settings ⚙️
Scroll down to the GitHub Pages Section and set the Source to master branch
.
Your repo is now hosting any html documents at the address given!
The URL will be the URL given followed by the name of the file:
http://annakrystalli.me/gapminderRR/gapminder-analysis.html
fostering reproducibility
empowering collaboration