-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
--- | ||
title: "| EEEB UN3005/GR5005\n| Homework - Week 01 - Due 04 Feb 2020" | ||
author: "USE THE NUMERIC PORTION OF YOUR UNI HERE" | ||
output: pdf_document | ||
fontsize: 12pt | ||
--- | ||
|
||
```{r setup, include = FALSE} | ||
knitr::opts_chunk$set(echo = TRUE) | ||
``` | ||
|
||
|
||
**Homework Instructions:** Complete this assignment by writing code in the code chunks provided. If required, provide written explanations below the relevant code chunks. Replace "USE THE NUMERIC PORTION OF YOUR UNI HERE" in the document header with the numbers appearing in your UNI. When complete, knit this document within RStudio to generate a PDF file. Please review the resulting PDF to ensure that all content relevant for grading (i.e., code, code output, and written explanations) appears in the document. Rename your PDF document according to the following format: hw_week_01_UNInumbers.pdf. Upload this final homework document to CourseWorks by 5 pm on the due date. | ||
|
||
|
||
## Problem 1 (3 points) | ||
|
||
Perform the following calculations in R code: | ||
|
||
a) 372 divided by 7.5 | ||
|
||
```{r} | ||
``` | ||
|
||
b) 14 squared | ||
|
||
```{r} | ||
``` | ||
|
||
c) Assign an object called `x` the sum of 24.7, 8.1, and 40. Show the resulting value of `x`. | ||
|
||
```{r} | ||
``` | ||
|
||
|
||
## Problem 2 (3 points) | ||
|
||
a) Assign an object called `my.nums` the values -6, 0, 6, and 12 using the `c()` function. Show the resulting values of `my.nums`. | ||
|
||
```{r} | ||
``` | ||
|
||
b) Assign an object called `my.nums2` the values -6, 0, 6, and 12 using the `seq()` function. Show the resulting values of `my.nums2`. | ||
|
||
```{r} | ||
``` | ||
|
||
|
||
## Problem 3 (4 points) | ||
|
||
a) Assign an object called `my.favs` the names of five of your favorite organisms (the scientific names). Show the resulting values of `my.favs`. | ||
|
||
```{r} | ||
``` | ||
|
||
b) Use bracket indexing (the `[ ]` functionality) to display only the second element in your `my.favs` vector. | ||
|
||
```{r} | ||
``` | ||
|
||
c) Use a combination of bracket indexing and the `:` operator to display the third *through* fifth elements in your `my.favs` vector. | ||
|
||
```{r} | ||
``` | ||
|
||
d) Run the line of code `rep(my.favs, times = 3)`. Describe (in written text below the code chunk) what this function is doing. | ||
|
||
```{r} | ||
``` |