```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```


In this lab you can use the interactive console to explore or **Knit** the document. 
Remember anything you type here can be "sent" to the console with Cmd-Enter (OS-X) or Ctrl-Enter (Windows/Linux) in an R code chunk.


# Part 1

### 1.1 

Create a new object called `my.num` that contains 6 numbers.

```
# General format
my.num <- c(number1, number2, ...)
```

```{r 1.1response}

```

### 1.2

Multiply `my.num` by 4.

```{r 1.2response}

```

### 1.3

Create a second object called `my.char` that contains 5 character strings.

```
# General format
my.char <- c("character1", "character2", ...)
```

```{r 1.3response}

```

### 1.4

Combine the two objects `my.num` and `my.char` into an object called `both`.

```{r 1.4response}

```

### 1.5

What is the length of `both`? Use the `length()` function.

```{r 1.5response}

```

### 1.6 

What class is `both`?

```{r 1.6response}

```


# Practice on Your Own!

### P.1

Create a vector that contains 4 sets of the numbers 1, 2, 3, and 4.

```{r P.1response}

```


# Part 2

### 2.1

Divide `both` by 3, what happens?

```{r, error=TRUE, label='2.1response'}

```

### 2.2

Create a vector with elements 1, 2, 3, 4, 5 and call it `x`.

```
# General format
x <- c(...)
```
 
```{r 2.2response}

```

### 2.3

Create another vector with elements 10, 20, 30, 40, 50 and call it `y`.

```
# General format
y <- c(...)
```

```{r 2.3response}

```

### 2.4

Determine the length of `x` and `y`. Next, add the vectors x and y together.

```{r 2.4response}

```

### 2.5

Append the value 60 onto the vector `y` (hint: you can use the `c()` function).

```
# General format
y <- c(y, ...)
```

```{r 2.5response}

```

### 2.6

Determine the length of `x` and `y`.

```{r 2.6response}

```

### 2.7

Add `x` and `y` together. What happens?

```{r 2.7response}

```


# Practice on Your Own!

### P.2

Multiply the following `a` and `b` together. How is this similar to the way R performs addition in #10 ?

```{r}
a <- c(1, 2, 3)
b <- c(10, 100, 1000)
```

```{r P.2response}

```

# Part 3

### 3.1

Create a vector object called `int_vect` that starts at 1 and goes up to 10. Use `seq()`.

```
# General format
seq(from = NUMBER, to = NUMBER)
```

```{r 3.1response}

```

### 3.2

Repeat the `int_vect` object this sequence 3 times using `rep()` and store the new object as `int_vect_3`.

```
# General format - times and each are optional
rep(x = OBJECT_TO_REPEAT, times = NUM_TIMES_TO_REPEAT, each = NUM_TIMES_TO_REPEAT_EACH_ELEMENT)
```

```{r 3.2response}

```

### 3.3

What is the length of `int_vect_3`?

```{r 3.3response}

```

### 3.4

Create a vector that takes the sequence "Strongly Agree", "Agree", "Neutral", "Disagree", "Strongly Disagree" and repeats each element 10 times.

```{r 3.4response}

```


# Practice on Your Own!

### P.3

"Strongly Agree", "Agree", "Neutral", "Disagree", "Strongly Disagree" are often responses to surveys. Create a randomly sampled vector of 30 survey responses. (hint use `sample()` and set the replace argument to `TRUE`). Store the output as `my_responses`. Examine the data by typing the name `my_responses` in the Console.

```{r P.3response}

```

### P.4

Let's say you change your survey so participants can rank their response 1-10 (inclusive). Create a randomly sampled vector of 30 survey responses. (hint use `seq()` and `sample()` and set the replace argument to `TRUE`). Store the output as `my_responses_2`. Examine the data by typing the name `my_responses_2` in the Console.

```{r P.4response}

```
