-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathhw01-assign.Rmd
262 lines (178 loc) · 10.9 KB
/
hw01-assign.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
---
title: 'hw01: Welcome to the Jungle'
author: 'STAT 385, Spring 2018'
date: 'Due: Friday, February 9th, 2018 at 11:59 PM'
output:
html_document:
theme: readable
toc: yes
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
# Overview
Please see the [homework policy](http://stat385.thecoatlessprofessor.com/homework-policy/)
for detailed instructions and some grading notes. Failure to follow instructions
will result in point reductions. In particular, make sure to commit each
exercise as you complete them.
> Hofstadter's Law: "It always takes longer than you expect, even when you take into account Hofstadter's Law."
>
> --- **Douglas Hofstadter**, Gödel, Escher, Bach: An Eternal Golden Braid
## Objectives
The objectives behind this homework assignment are as follows:
- Create an _RMarkdown_ document and write using _Markdown_ syntax;
- Apply the principles of literate programming by embedding code and describing outcomes;
- Read in data;
- Provide data overviews;
- Clone a `git` Repository;
- Commit and Push changes to a `git` repository;
- Become familiar with the homework procedures of the course.
## Grading
The rubric CAs will use to grade this assignment is:
| Task | pts |
|:-------------------------------------------------------|----:|
| Link to GitHub Repository | 2 |
| Agree to the homework policy | 2 |
| Verifying computing environment is setup | 2 |
| Listing where to get help in person | 2 |
| Writing in _RMarkdown_ | 10 |
| Working with Baby Name Data | 10 |
| Exploring the Excellent Teachers list at UIUC | 12 |
| At least one commit per exercise (more is better!) | 5 |
| Commit messages that describe what changed | 5 |
| Total | 50 |
## Note on Markdown
If you need help with markdown syntax, please go to the "Help" menu and select the
_Markdown Quick Reference_ guide. This will open in the **Help** tab on
the _lower-right_ corner of _RStudio_. For more examples, please see
[the literate programming slides](http://stat385.thecoatlessprofessor.com/lectures/02-literate-programming/02-literate-programming.pdf#page=26) and the [in class examples of writing in _RMarkdown_](https://dl.dropboxusercontent.com/s/djhtvrr2f07uyzi/01-22-2018-rmarkdown-sample.Rmd?dl=0).
# Assignment
## (2 points) Exercise 0: Get aboard the GitHub Bus!
Place a link to your `hw01` GitHub repository here.
## (2 points) Exercise 1: Homework Policy
Please uncomment the following statement when you have read and agreed
to the [homework policy](http://stat385.thecoatlessprofessor.com/homework-policy/).
To _uncomment_ a statement in _RMarkdown_ delete the `<!-- -->` surrounding
the content.
<!-- I have read and agree to abide by the policies and procedures laid
out by the [homework policy](http://stat385.thecoatlessprofessor.com/homework-policy/).
I understand that:
- I must independently write up solutions to homework problems.
- Failure to do so will result in an academic integrity violation due to plagarism and more severe penalties.
- I must list the names of all collaborators that I work with at the top of
my homework assignment.
- I understand that I can work with **at most** three other students in class.
- I will turn in my homework by committing to the GitHub repository that was
setup for me via GitHub classrooms.
- There is no paper or e-mail turn-in available.
- I must make all commits using `git` and _not_ the GitHub web interface.
- If I do, I will lose all the points associated with the `git` commits.
- I will be able to drop one homework assignment over the course of the
semester.
-->
## (2 points) Exercise 2: [Help! I need somebody](https://www.youtube.com/watch?v=CTsB-llTzyc)
Please answer:
1. Who is part of the STAT 385 instructional staff?
1. Where are **all** STAT 385's Office Hours?
1. When do the office hours take place during the week?
Answers to these questions can be found on the main page of the course website:
<http://stat385.thecoatlessprofessor.com/>
## (2 Points) Exercise 3: Know Thine Environment
Please take screenshots of the following and include them in your _RMarkdown_ document:
1. the [RStudio Cloud STAT 385 Workspace](https://rstudio.cloud/spaces/960).
2. the [STAT 385 Discussion Forum](https://github.com/stat385-sp2018/disc/issues)
- To get access to this forum, we _must_ know your GitHub Username.
- Please fill out this survey: <https://goo.gl/forms/n0U7Q87walHvNAhi2>
- Having issues logging in? Please see the
[walkthrough guide](http://stat385.thecoatlessprofessor.com/readings/00-google-forms/00-google-forms.html)
or the
[FAQ entry](http://stat385.thecoatlessprofessor.com/faq/#technical-google-forms)
To take a screenshot press:
- Windows: [`Windows Key` + `PrtScn`](http://windows.microsoft.com/en-us/windows/take-screen-capture-print-screen#take-screen-capture-print-screen=windows-8) or use the [Snipping tool](http://windows.microsoft.com/en-us/windows/use-snipping-tool-capture-screen-shots#1TC=windows-8)
- macOS: [`Command` + `Shift` + `3`](https://support.apple.com/en-us/HT201361) or use [`Command` + `Shift` + `4`](https://support.apple.com/en-us/HT201361) for part of your screen.
## (10 Points) Exercise 4: Who I Am
If you need help with markdown syntax, please go to the "Help" menu and select the
_Markdown Quick Reference_ guide. This will open in the **Help** tab on
the _lower-right_ corner of _RStudio_. For more examples, please see
[the literate programming slides](http://stat385.thecoatlessprofessor.com/lectures/02-literate-programming/02-literate-programming.pdf#page=26) and the [in class examples of writing in _RMarkdown_](https://dl.dropboxusercontent.com/s/djhtvrr2f07uyzi/01-22-2018-rmarkdown-sample.Rmd?dl=0).
- Create a self-portrait of yourself by either taking a picture or sketching it.
Include this self-portrait within the _RMarkdown_ document.
- Make sure to upload and commit your photo!
- Make a 7 by 2 table in markdown that has a header row containing "Overview" and "Who I Am".
- Under the "Overview" column, please write entries using bold text for:
Full Name, NetID, Birthday, Year in School, Major, and Expected Graduation Date
- Under the "Who I Am" column, please fill in your personal information.
- Compile **ordered** lists for each of your favorite:
- foods;
- TV shows;
- movies;
- music (add links to music videos on either YouTube or Vimeo).
- Devise _two_ **unordered** lists that contain your most recent memorable events
and where you typically spend your free time.
- Write the following formula as an _inline_ equation.
- For help writing in LaTeX, see the following symbol's guide: <https://artofproblemsolving.com/wiki/index.php/LaTeX:Symbols> and see
[`lab00` solutions](https://github.com/stat385-sp2018/lab00-coatless/blob/master/rmarkdown-examples/rmarkdown-example.Rmd).

- What is the name of your favorite mathematical formula? Include the
formula itself using _display mode_ and a link to its wikipedia entry.
- For inspiration, check out [Wikipedia's Mathematical Formula list](https://en.wikipedia.org/wiki/List_of_equations)!
- **Note:** You _cannot_ select the pythagorean theorem, golden ratio, or
quadratic formula as those were given as examples in
[`lab00`](https://github.com/stat385-sp2018/lab00/blob/master/rmarkdown-examples/rmarkdown-example.Rmd).
Commit and push your work onto GitHub.
## (10 Points) Exercise 5: Got baby?
**[2 Points] (a)** Install and load the `babynames` package.
**Comment** out the installation command in your `.Rmd` file.
(If you do not comment installation commands out, then they will be run
every time you knit your `.Rmd` file.)
**[2 Points] (b)** Open up the help documentation for `babynames` (the data set),
find where the variables for the data set are listed and write in your
_RMarkdown_ document _how_ the `prop` variable was created.
**[6 Points] (c)** Provide summary information on the `babynames` by:
- writing a sentence that _dynamically_ describes the dimensions of the data;
- showing the last six observations in the data set; and,
- providing a summary overview of the data to understand its contents.
## (12 Points) Exercise 6: Excellency at UIUC
Under this exercise, we will explore the "Teachers Ranked As Excellent" data
at UIUC from Fall 1993 to Present as compiled by [Wade Fagen-Ulmschneider
](http://waf.cs.illinois.edu/). Please download the data from:
<https://raw.githubusercontent.com/wadefagen/Teachers-Ranked-As-Excellent-UIUC/master/TRE-UIUC-AllYears.csv>
This data has a file extension of **CSV** form. Contained in the data are the
following variables:
- `term`: Two letter semester code (`sp`, `su`, `fa`, or `wi`) followed by a four digit year.
- Examples: `sp2017`, `fa2013`, `su2012`.
- `unit`: The CITL-supplied headers for the unit teaching the course.
- Examples: `ACCOUNTANCY`, `SOCIAL WORK`, `LINGUISTICS`, `NUCLEAR, PLASMA & RAD. ENGR.`
- `lname`: The last name of the teacher.
- Examples: `FAGEN-ULMSCHNEIDER`, `FLANAGAN`, `FLECK`
- `fname`: The first letter of the first name of the teacher.
- Examples: `W`, `K`, `M`
- `role`: `Instructor` or `TA`
- `ranking`: `Excellent` or `Outstanding`
- `course`: The course the teacher was ranked as excellent. If no course is given, the `course` field is set to `?` (this includes cases when the raw data lists the course as `0`, `000`, or `999`).
- Examples: `199`, `225`, `560`, `?`
**[2 points] (a)** Import into _R_ the data in `TRE-UIUC-AllYears.csv` with the
variable name `tre_data`. As `course` contains a value that is _not_ `NA`, which
is how _R_ represents missing values, you must use the parameter
`na.strings = c("?", "NA")` in the appropriate `read.*()` function.
If you need help, please see the appropriate help documentation via `?`.
**NB** The `*` in the `read.*()` statement is a placeholder for the type of file
you want to read in.
**[2 points] (b)** Retrieve the dimensional information for this data using
only one function.
**[4 points] (c)** Perform a summary of the `tre_data`. Are there any summaries
that are surprising? What might have caused this?
_Hint_ Consider looking at the structure of `tre_data`.
**[4 points] (d)** Fix the following code so that it:
1. doesn't error;
1. produces a graph; and
1. hides the code.
_Hint_ for the last exercise look at different code chunk options.
```{r ggplot2-code, eval = FALSE}
ggplot(tre_data, aes(ranking)) +
geom_bar() +
facet_wrap( ~role) +
theme(axis.text.x = element_text(angle = 45, hjust = 1)) +
labs(y = "Frequency",
x = "Excellency Rating")
```