Skip to content

Commit 2fbed91

Browse files
committed
Update md files
1 parent 59dcf98 commit 2fbed91

File tree

1 file changed

+38
-42
lines changed

1 file changed

+38
-42
lines changed

_episodes/00-intro.md

+38-42
Original file line numberDiff line numberDiff line change
@@ -5,50 +5,34 @@ title: "Before we Start"
55
teaching: 25
66
exercises: 15
77
questions:
8-
- "How to find your way around RStudio?"
9-
- "How to interact with R?"
10-
- "How to manage your environment?"
11-
- "How to install packages?"
8+
- "How do you get a GitHub account?"
9+
- "How do you use Git with RStudio?"
1210
objectives:
13-
- "Install latest version of R."
11+
- "Register for a GitHub account."
1412
- "Install latest version of RStudio."
15-
- "Navigate the RStudio GUI."
16-
- "Install additional packages using the packages tab."
17-
- "Install additional packages using R code."
13+
- "Use RStudio for version control."
1814
keypoints:
1915
- "Use RStudio to write and run R programs."
20-
- "Use `install.packages()` to install packages (libraries)."
16+
- "Use RStudio to interact with GitHub."
2117
source: Rmd
2218
---
2319

2420

2521

2622
## R and RStudio
2723

28-
R is an open source programming language originally designed and implemented by
29-
statisticians primarily for statistical analysis. It includes high quality
30-
graphics capabilities and tools for data analysis and reading and writing data
31-
to/from files.
32-
33-
Because R is open source and is supported by a large community of developers and
34-
users there is a very large selection of third-party add-on packages which are
35-
freely available to extend R's native capabilities.
36-
37-
R is a scripted language. Rather than pointing and clicking in a graphical
38-
environment you write code statements to ask R to do something for you. This has
39-
the advantage of providing a record of what was done and allows for peer review
40-
of the work undertaken.
41-
42-
Having this written record, something which is increasingly required as part of
43-
a publication submission, is also an aid when seeking help with problems.
44-
45-
There are many online resources such as
24+
You should already be familiar with R, either through participating in a Software
25+
or Data Carpentry workshop or having learned R some other way. As you are probably
26+
aware, there are a variety of online resources where you can get help and valuable
27+
advice. These include
4628
[stackoverflow](https://stackoverflow.com/questions/tagged/r) and the [RStudio
4729
Community](https://community.rstudio.com/) which will allow you to seek help
4830
from peers. Questions which are backed up with [short, reproducible code
4931
snippets](https://www.tidyverse.org/help/) are more likely to attract knowledgeable responses.
5032

51-
To make it easier to interact with R, we will use RStudio. RStudio is the most popular IDE (Integrated Development Interface), to work with R. An IDE is a software that provide tools to make it easier to program.
33+
In this course we will use RStudio to interact with R. RStudio is the most popular IDE (Integrated Development Interface),
34+
to work with R. An IDE is a software that provide tools to make it easier to program. If you
35+
haven't used RStudio before, now is a good time to familiarise yourself with the interface.
5236

5337
<figure>
5438
<img src="../fig/r+rstudio-analogy.jpg" title="RStudio extends what R can do, and make it easier to write R code and interact with R." alt="RStudio extends what R can do, and make it easier to write R code and interact with R." style="display: block; margin: auto;" />
@@ -170,27 +154,39 @@ Directory". Alternatively you can use `setwd("/path/to/working/directory")` to
170154
reset your working directory. However, your scripts should not include this line
171155
because it will fail on someone else's computer.
172156

157+
## Cloning an existing project from GitHub
173158

174-
### Downloading the data and getting set up
159+
Instead of starting a new project from scratch you may wish to use an existing
160+
project that is available online, e.g. through GitHub. Such a project may provide
161+
a predefined directory structure containing relevant data as well as R scripts.
162+
This allows you to build on existing work (either by you or others).
175163

176-
For this lesson we will use the following folders in our working directory: **`data/`**, **`data_output/`** and **`fig_output/`**. Let's write them all in lowercase to be consistent. We can create them using the RStudio interface by clicking on the "New Folder" button in the file pane (bottom right), or directly from R by typing at console:
164+
### Forking the project repository
177165

166+
During this course we will work with a project from GitHub. To get this setup
167+
on your laptop, navigate to [https://github.com/humburg/r-ggplot-project](https://github.com/humburg/r-ggplot-project)
168+
and click on the *Fork* button.
178169

179-
~~~
180-
dir.create("data")
181-
dir.create("data_output")
182-
dir.create("fig_output")
183-
~~~
184-
{: .language-r}
170+
![Forking the workshop's project on GitHub.](../fig/R_00_github_fork.png)
185171

186-
Go to the Fighare page for this curriculum, and download the dataset called "`SAFI_clean.csv`". The direct download link is: <https://ndownloader.figshare.com/files/11492171>. Place this downloaded file in the `data/` you just created. You can do this directly from R by copying and pasting this in your terminal (your instructor can place this chunk of code in the Etherpad):
172+
This will create a copy of the project in your own GitHub account, allowing
173+
you to modify it as you see fit and pushing those changes back to GitHub.
187174

175+
### Cloning the project repository
176+
177+
Before you can do any work on this project you'll need a working copy on your
178+
computer. First, navigate to the GitHub site for your freshly forked repository.
179+
GitHub should have loaded that for you after completing the forking process.
180+
Click on the green *Clone or download* button and coppy the displayed url.
181+
182+
![Obtaining the right url to clone the project from GitHub.](../fig/R_00_clone_url.png)
183+
184+
Now, switch back to RStudio and create a new project. Choose *Version Control* and *Git*.
185+
This should present you with a dialogue where you can enter the details you just copied
186+
from GitHub.
187+
188+
![Using RStudio to clone a project from GitHub.](../fig/R_02_clone_project.png)
188189

189-
~~~
190-
download.file("https://ndownloader.figshare.com/files/11492171",
191-
"data/SAFI_clean.csv", mode = "wb")
192-
~~~
193-
{: .language-r}
194190

195191
## Interacting with R
196192

0 commit comments

Comments
 (0)