-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathgithub.Rmd
73 lines (59 loc) · 3.4 KB
/
github.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
---
title: "Using git and GitHub"
author: "[Michael Love](http://mikelove.github.io)"
output: html_document
---
This class is hosted on GitHub, and we will use the `git` program and GitHub accounts
to distribute lecture notes and homework assignments.
We talked about RStudio, git and GitHub in class, but to review:
* [RStudio](https://www.rstudio.com/) is an interface to R, with support for git and GitHub integration
* `git` is a program for version control (mostly useful for plain text documents)
* GitHub and BitBucket are websites/companies which host `git` repositories
GitHub and BitBucket both offer free public or private repositories.
GitHub seems to be more popular for open source projects. For this
course, we will use private repositories for turning in homeworks and
final projects, which are available because the course is labeled as
an educational *organization* on GitHub.
You can start a `git` repository (repo) by either *cloning* an existing repo
(as you will do for this course), or *initializing* a repo
from scratch.
We want to clone the course repo in RStudio, but first, we may need to
install or upgrade the software on your computer. We need to do the following
steps:
* Install/upgrade R to version 4.4.1 (ideal to use latest version)
* Install RStudio for Desktop
* Install git
* Hook RStudio up to use git and GitHub
The first step can be done by visiting [CRAN](cran.r-project.org), and
clicking the appropriate link for your operating system. When you load R,
you want it to say that R is version 4.4.1 when you type `sessionInfo()`.
The second step can be done by visiting the [RStudio](https://www.rstudio.com/) website.
The third and fourth step are best accomplished by following the instructions
at the [happygitwithr](http://happygitwithr.com/) website. To follow
along with the course, you just need to clone the course repository
from GitHub. However, to turn in homework, you will also need to
*commit* and *push* your local work into private assignment repos. So
you should follow the instructions at the link above to: register a
GitHub account, install git, introduce yourself to git, set up keys
for SSH, connect RStudio to Git and GitHub.
This class has two "views" you might say.
The [HTML/website version](https://biodatascience.github.io/compbio/) and the
[GitHub version](https://github.com/biodatascience/compbio_src) which
has all the "source" Rmarkdown files. From the GitHub version,
you can poke around, and click on Rmarkdown files, even see the history of the code.
If you want to look at the raw text for an Rmd file,
you can click the **Raw** link on the top of the document.
To clone the class repo, you should go to the GitHub version of this class
and look for a green link that says "Clone or download".
You should copy the link that appears to the clipboard.
Now, open RStudio, and follow the menu items:
*File > New Project > Version Control > Git*.
You will paste the link from the previous step into the box that
says "repository URL". You can set the project directory name to `compbio`.
Following this, you should see a number of directories, which contain
`Rmd` files in the Files panel on the lower right hand side. And there
will be a git tab in the top right panel. The git tab will allow you
to **pull** down new material as the course goes on and homeworks are
posted to the course repo.
We will explain in class how you will keep a private repo for turning
in assignments.