You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -22,14 +23,14 @@ push your corresponding chapters’ work to.
22
23
23
24
- In **GitHub Desktop**, click Current Branch –\> New Branch
24
25
25
-
<img src="Images/create_new_ch_1_branch.png"
26
-
alt="GitHub Desktop screen where 'Current Branch' is selected and 'New Branch' button is visible"
26
+
<img src="Images/create_new_ch_1a_branch.png"
27
+
alt="GitHub Desktop screen where 'Current Branch' is selected and 'New Branch' button is visible. Both are circled in red."
27
28
style="width: 55%;">
28
29
29
-
- Name the branch ‘chapter-01’ and click ‘Create Branch’
30
+
- Name the branch ‘chapter-01a’ and click ‘Create Branch’
30
31
31
-
<img src="Images/name_new_branch_ch_1.png"
32
-
alt="GitHub Desktop screen upon creation of new branch, a name 'chapter-01' is given and 'Create Branch' button is visible in blue"
32
+
<img src="Images/name_new_branch_ch_1a.png"
33
+
alt="GitHub Desktop screen upon creation of new branch, a name 'chapter-01a' is given and 'Create Branch' button is visible in blue"
33
34
style="width: 55%;">
34
35
35
36
**Create Your First Quarto Notebook:**
@@ -71,23 +72,23 @@ in your R Console.
71
72
- File –\> New File –\> Quarto Document…
72
73
73
74
<img src="Images/create_new_quarto_file.png"
74
-
alt="RStudio screen showing button navigation to create a new quarto document"
75
+
alt="RStudio screen showing button navigation to create a new quarto document. 'File', 'New file', and Quarto document...' are all circled in red."
75
76
style="width: 55%;">
76
77
77
78
4. Name your Quarto document
78
79
79
-
- Title file ‘Chapter 1’
80
+
- Title file ‘Chapter 1a’
80
81
-**deselect** ‘Use visual markdown editor’
81
82
- Click ‘Create Empty Document’
82
83
83
84
<img src="Images/name_new_quarto_file.png"
84
-
alt="RStudio screen upon creating new quarto document: title box changed to 'Chapter 1', 'Use visual markdown editor' is deselected, and 'Create Empty Document' button is present and circled in red."
85
+
alt="RStudio screen upon creating new quarto document: title box changed to 'Chapter 1a', 'Use visual markdown editor' is deselected, and 'Create Empty Document' button is present and circled in red."
85
86
style="width: 55%;">
86
87
87
88
You will see something like the following…
88
89
89
-
<img src="Images/ch_1_quarto_file.png"
90
-
alt="RStudio screen with newly created 'Chapter 1' quarto document. The file is blank besides the YAML header with 'title: Chapter 1' and 'format: html'."
90
+
<img src="Images/ch_1a_quarto_file.png"
91
+
alt="RStudio screen with newly created 'Chapter 1a' quarto document. The file is blank besides the YAML header with 'title: Chapter 1a' and 'format: html'."
91
92
style="width: 55%;">
92
93
93
94
5. Change the YAML Header
@@ -101,7 +102,7 @@ output is a markdown file. We want to render to a gfm (GitHub Flavored
101
102
Markdown), specifically, as it is optimized for viewing on GitHub.
102
103
103
104
<img src="Images/change_yaml_header.png"
104
-
alt="Cropped screenshot of top left corner of RStudio screen. The YAML header has the correct 'Chapter 1' title but the output format has been changed to 'format: gfm'."
105
+
alt="Cropped screenshot of top left corner of RStudio screen. The YAML header has the correct 'Chapter 1a' title but the output format has been changed to 'format: gfm'."
105
106
style="width: 55%;">
106
107
107
108
6. Load Libraries from the Installed Packages.
@@ -111,6 +112,8 @@ Next, we need to load the libraries from the packages into our new
111
112
project. Unlike installing packages, you need to load the libraries each
112
113
new session.
113
114
115
+
**Load Libraries**
116
+
114
117
Thus far you have been working in your Console. You will now switch to
115
118
writing commands in your own **Quarto document**! But don’t worry, your
116
119
Console will still appear at the bottom of your RStudio screen. To
@@ -140,7 +143,7 @@ dropdown box will appear, click “Run Current Chunk” to run the
140
143
**entire** chunk.
141
144
142
145
<img src="Images/run_current_chunk.png"
143
-
alt="RStudio screen navigated to the top right 'Run' button, circled in red."
146
+
alt="RStudio screen navigated to the top right 'Run' button and 'Run current chunk' button, both circled in red."
144
147
style="width: 55%;">
145
148
146
149
You will see the following output:
@@ -161,7 +164,7 @@ library(ggthemes)
161
164
```
162
165
163
166
<img src="Images/run_selected_lines.png"
164
-
alt="RStudio screen when running selected lines of a command. In this case, to load two libraries, 'palmerpenguins' and 'ggthemes'."
167
+
alt="RStudio screen when running selected lines of a command."
165
168
style="width: 55%;">
166
169
167
170
AMAZING work! Now, let’s *really* get into it.
@@ -234,5 +237,50 @@ right arrow located on the top of your RStudio screen.
Now, to wrap up Chapter 1a, you will learn to use GitHub to make your
241
+
work viewable to others (and also reproducible)! You will push your
242
+
Chapter 1a work to GitHub, creating a pull request in the process. This
243
+
pull request will allow a mentor to review your work each chapter.
244
+
245
+
Remember that Chapter 1a branch you created? After you save your Quarto
246
+
notebook, you are going to push all of your new Chapter 1a changes to
247
+
that branch on GitHub, so your work will be visible on the
248
+
UCSC-Treehouse organization.
249
+
250
+
Lastly, you will request your mentor as a ‘reviewer’, so they can check
251
+
over your work *before* you officially merge it with the main branch.
252
+
253
+
Navigate back to **GitHub Desktop**… You should see your new changes
254
+
highlighted in red.
255
+
256
+
1. Push new Chapter 1a changes to chapter-01a branch
257
+
258
+
<img src="Images/push_ch_1a_to_ch_1a_branch.png"
259
+
alt="Cropped image of bottom left corner of GitHub Desktop screen where description 'Create and complete chapter 1a' is given and blue 'Commit 1 file to chapter-01a' button is circled in red at the bottom."
260
+
style="width: 55%;">
261
+
262
+
2. Publish the new chapter-01a branch
263
+
264
+
<img src="Images/publish_ch_1a_branch.png"
265
+
alt="GitHub Desktop screen where blue 'Publish branch' button is present and circled in red."
266
+
style="width: 55%;">
267
+
268
+
3. Create a pull request
269
+
270
+
<img src="Images/create_pull_request.png"
271
+
alt="GitHub Desktop screen after committing changes to new branch, prompted to click 'Create Pull Request' button in blue."
272
+
style="width: 55%;">
273
+
274
+
You will be relocated to the **GitHub browser**.
275
+
276
+
1. Add your mentor as a reviewer (**Note**: here I use ‘hbeale’ but
277
+
make sure you are adding *your* mentor’s GitHub id)
alt="GitHub browser screen upon creating a pull request. On the right-hand side, a reviewer is added. The example shows 'hbeale' as reviewer, circled in red."
Copy file name to clipboardExpand all lines: Chapter-Instructions/Chapter_01a_Instructions.qmd
+57-14Lines changed: 57 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,10 @@
1
1
---
2
-
title: "Chapter 1a, RStudio"
2
+
title: "Chapter 1a, RStudio and GitHub"
3
3
format: gfm
4
4
---
5
5
6
6
In this first section of Chapter 1 you will create and work on a new branch on GitHub, create a **Quarto document**, and have a brief introduction to plotting.
7
+
Then, you will **push** your Chapter 1a work to a Chapter-1a branch, for your mentor's review.
@@ -19,14 +20,14 @@ For each chapter you work through, you will create a new quarto document *and* a
19
20
20
21
- In **GitHub Desktop**, click Current Branch --\> New Branch
21
22
22
-
<img src="Images/create_new_ch_1_branch.png"
23
-
alt="GitHub Desktop screen where 'Current Branch' is selected and 'New Branch' button is visible"
23
+
<img src="Images/create_new_ch_1a_branch.png"
24
+
alt="GitHub Desktop screen where 'Current Branch' is selected and 'New Branch' button is visible. Both are circled in red."
24
25
style="width: 55%;">
25
26
26
-
- Name the branch 'chapter-01' and click 'Create Branch'
27
+
- Name the branch 'chapter-01a' and click 'Create Branch'
27
28
28
-
<img src="Images/name_new_branch_ch_1.png"
29
-
alt="GitHub Desktop screen upon creation of new branch, a name 'chapter-01' is given and 'Create Branch' button is visible in blue"
29
+
<img src="Images/name_new_branch_ch_1a.png"
30
+
alt="GitHub Desktop screen upon creation of new branch, a name 'chapter-01a' is given and 'Create Branch' button is visible in blue"
30
31
style="width: 55%;">
31
32
32
33
**Create Your First Quarto Notebook:**
@@ -63,23 +64,23 @@ This is always done in your R Console.
63
64
- File --\> New File --\> Quarto Document...
64
65
65
66
<img src="Images/create_new_quarto_file.png"
66
-
alt="RStudio screen showing button navigation to create a new quarto document"
67
+
alt="RStudio screen showing button navigation to create a new quarto document. 'File', 'New file', and Quarto document...' are all circled in red."
67
68
style="width: 55%;">
68
69
69
70
4. Name your Quarto document
70
71
71
-
- Title file 'Chapter 1'
72
+
- Title file 'Chapter 1a'
72
73
-**deselect** 'Use visual markdown editor'
73
74
- Click 'Create Empty Document'
74
75
75
76
<img src="Images/name_new_quarto_file.png"
76
-
alt="RStudio screen upon creating new quarto document: title box changed to 'Chapter 1', 'Use visual markdown editor' is deselected, and 'Create Empty Document' button is present and circled in red."
77
+
alt="RStudio screen upon creating new quarto document: title box changed to 'Chapter 1a', 'Use visual markdown editor' is deselected, and 'Create Empty Document' button is present and circled in red."
77
78
style="width: 55%;">
78
79
79
80
You will see something like the following...
80
81
81
-
<img src="Images/ch_1_quarto_file.png"
82
-
alt="RStudio screen with newly created 'Chapter 1' quarto document. The file is blank besides the YAML header with 'title: Chapter 1' and 'format: html'."
82
+
<img src="Images/ch_1a_quarto_file.png"
83
+
alt="RStudio screen with newly created 'Chapter 1a' quarto document. The file is blank besides the YAML header with 'title: Chapter 1a' and 'format: html'."
83
84
style="width: 55%;">
84
85
85
86
5. Change the YAML Header
@@ -91,7 +92,7 @@ Changing the header of the document to 'format: gfm' ensures that the output is
91
92
We want to render to a gfm (GitHub Flavored Markdown), specifically, as it is optimized for viewing on GitHub.
92
93
93
94
<img src="Images/change_yaml_header.png"
94
-
alt="Cropped screenshot of top left corner of RStudio screen. The YAML header has the correct 'Chapter 1' title but the output format has been changed to 'format: gfm'."
95
+
alt="Cropped screenshot of top left corner of RStudio screen. The YAML header has the correct 'Chapter 1a' title but the output format has been changed to 'format: gfm'."
95
96
style="width: 55%;">
96
97
97
98
6. Load Libraries from the Installed Packages.
@@ -100,6 +101,8 @@ Installing new packages does not mean they are ready to use just yet.
100
101
Next, we need to load the libraries from the packages into our new project.
101
102
Unlike installing packages, you need to load the libraries each new session.
102
103
104
+
**Load Libraries**
105
+
103
106
Thus far you have been working in your Console.
104
107
You will now switch to writing commands in your own **Quarto document**!
105
108
But don't worry, your Console will still appear at the bottom of your RStudio screen.
@@ -125,7 +128,7 @@ To run a command, click the "Run" button on the top right of your RStudio screen
125
128
A dropdown box will appear, click "Run Current Chunk" to run the **entire** chunk.
126
129
127
130
<img src="Images/run_current_chunk.png"
128
-
alt="RStudio screen navigated to the top right 'Run' button, circled in red."
131
+
alt="RStudio screen navigated to the top right 'Run' button and 'Run current chunk' button, both circled in red."
129
132
style="width: 55%;">
130
133
131
134
You will see the following output:
@@ -146,7 +149,7 @@ library(ggthemes)
146
149
```
147
150
148
151
<img src="Images/run_selected_lines.png"
149
-
alt="RStudio screen when running selected lines of a command. In this case, to load two libraries, 'palmerpenguins' and 'ggthemes'."
152
+
alt="RStudio screen when running selected lines of a command."
150
153
style="width: 55%;">
151
154
152
155
AMAZING work! Now, let's *really* get into it.
@@ -210,4 +213,44 @@ Render your Chapter 1a work by clicking the "Render" button by the blue right ar
Now, to wrap up Chapter 1a, you will learn to use GitHub to make your work viewable to others (and also reproducible)!
217
+
You will push your Chapter 1a work to GitHub, creating a pull request in the process.
218
+
This pull request will allow a mentor to review your work each chapter.
219
+
220
+
Remember that Chapter 1a branch you created?
221
+
After you save your Quarto notebook, you are going to push all of your new Chapter 1a changes to that branch on GitHub, so your work will be visible on the UCSC-Treehouse organization.
222
+
223
+
Lastly, you will request your mentor as a 'reviewer', so they can check over your work *before* you officially merge it with the main branch.
224
+
225
+
Navigate back to **GitHub Desktop**...
226
+
You should see your new changes highlighted in red.
227
+
228
+
1. Push new Chapter 1a changes to chapter-01a branch
229
+
230
+
<img src="Images/push_ch_1a_to_ch_1a_branch.png"
231
+
alt="Cropped image of bottom left corner of GitHub Desktop screen where description 'Create and complete chapter 1a' is given and blue 'Commit 1 file to chapter-01a' button is circled in red at the bottom."
232
+
style="width: 55%;">
233
+
234
+
2. Publish the new chapter-01a branch
235
+
236
+
<img src="Images/publish_ch_1a_branch.png"
237
+
alt="GitHub Desktop screen where blue 'Publish branch' button is present and circled in red."
238
+
style="width: 55%;">
239
+
240
+
3. Create a pull request
241
+
242
+
<img src="Images/create_pull_request.png"
243
+
alt="GitHub Desktop screen after committing changes to new branch, prompted to click 'Create Pull Request' button in blue."
244
+
style="width: 55%;">
245
+
246
+
You will be relocated to the **GitHub browser**.
247
+
248
+
1. Add your mentor as a reviewer (**Note**: here I use 'hbeale' but make sure you are adding *your* mentor's GitHub id)
alt="GitHub browser screen upon creating a pull request. On the right-hand side, a reviewer is added. The example shows 'hbeale' as reviewer, circled in red."
Copy file name to clipboardExpand all lines: Chapter-Instructions/Chapter_01b_Instructions.qmd
+8Lines changed: 8 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,14 @@ format: gfm
5
5
6
6
Now that you have created your first plot, you will begin to explore data visualization with **ggplot2**: navigating variables, distribution, plots, and varying aesthetic options.
7
7
8
+
**REMEMBER**: **For each of the following chapters, create a new branch corresponding to that chapter.**
9
+
**Continue to work on the examples, exercises, and write any notes you may want.**
10
+
**Then, save and render the document, before committing and pushing those changes to the corresponding new branch on GitHub desktop.**
11
+
**Create a pull request, requesting your mentor's review.**
12
+
**You will learn what happens after your pull request is approved in Chapter 1c.**
First, we need to define a **geom**: a geometrical object that a plot uses to represent data.
9
17
For example, bar charts use bar geoms with geom_bar(), line charts can be displayed with line geoms using geom_line(), and boxplots with geom_boxplot().
10
18
Let's create a scatterplot using a point geom with geom_point():
0 commit comments