You will submit your homework as an R Markdown (.Rmd
) file by committing to your git
repository and pushing to GitLab. We will knit this file to produce the .html
output file (you do not need to submit the .html
, but you should make sure that it can be produced successfully).
We will review both your .Rmd
file and the .html
file. To receive full credit:
You must submit your .Rmd
file on time. It must be named exactly as specified, and it must knit without errors to produce a .html
file.
The .html
file should read as a well written report, with all results and graphs supported by text explaining what they are and, when appropriate, what conclusions can be drawn. Your report should not contain any extraneous material, such as leftovers from a template.
The R code in your .Rmd
file must be clear, readable, and follow the coding standards.
The text in your .Rmd
file must be readable and use R markdown properly, as shown in the class template file.
Take possession of your GitLab repository in the course group on the UIowa GitLab server.
Create a new folder called HW1
in your repository. Use exactly this spelling with upper case letters. You can do this in the RStudio IDE, with R’s dir.create
function, or using a shell.
In this folder, create a new Rmarkdown file called hw1.Rmd
. Again use exactly this spelling. RStudio will give you a template, or you can use the one available here. Commit your new file to your repository. (If you are using git
in a shell you will need to use git add
before git commit
).
In this file present your answers to the following problems. Your presentation should follow the pattern and guidelines in the class template file.
Using the faithful
data set compute the average waiting time between eruptions of the Old Faithful geyser. Report your result in the a sentence of the form
faithful
is X minutes.with X replaced by the correct value computed with inline code in your .Rmd
file. Make sure to use proper markup to have Old Faithful in italics and faithful
rendered as code (in a fixed width font with a gray backround).
Compute the first four eruption durations in the faithful
data sets. Use a code chunk that shows both the code and the results as produced by R. Don’t forget to include a sentence explaining what you are showing.
Using the head
function compute the first five rows of the faithful
data frame and show the result as a nicely formatted table. In this case your report should show only the table, not the code that produces it. You can start with this code chunk:
```{r, echo = FALSE}
d <-data.frame(x = c(1, 2, 3), y = c(4, 5, 6))
kbl <- knitr::kable(d, format = "html")
kableExtra::kable_styling(kbl, full_width = FALSE)
```
Use the hist
function to create a histogram of the eruption durations in the faithful
data set. (?help
and example(hist)
may be useful). Describe any interesting features of the distribution that you notice.
You can create an HTML file in RStudio using the Knit
tab on the editor window. You can also use the R command
rmarkdown::render("hw1.Rmd")
with your working directory set to HW1
.
Commit your changes to your hw1.Rmd
file to your local git repository. You do not heed to commit your HTML file.
Submit your work by pushing your local repository changes to your remote repository on the UI GitLab site. After doing this, it is a good idea to check your repository on the UI GitLab site to make sure everything has been submitted successfully