Skip to content

Commit

Permalink
Adding week 01 homework
Browse files Browse the repository at this point in the history
  • Loading branch information
eveskew committed Jan 30, 2020
1 parent a7c16c4 commit a3b1fd0
Showing 1 changed file with 79 additions and 0 deletions.
79 changes: 79 additions & 0 deletions homework/hw_week_01.Rmd
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}
```

0 comments on commit a3b1fd0

Please sign in to comment.