Instructions

Complete the indicated exercises from Modern Statistics with R. Place your code in the provided chunks and whatever commentary is called for outside the chunks.

Exercise 2.1

1 * 2 * 3 * 4 * 5 * 6 * 7 * 8 * 9 * 10
## [1] 3628800

Exercise 2.2

a <-  924 + 124
a^2
## [1] 1098304

Exercise 2.3.1

income2 <- taxes2 <- 100
income2; taxes2 
## [1] 100
## [1] 100
taxes2 <- 30 
income2; taxes2 
## [1] 100
## [1] 30

Exercise 2.3.2

#income2 <- taxes2 <- 100
#income2; taxes2 
#taxes2 <- 30 
#income2; taxes2 

Exercise 2.3.3

income2 <- taxes2 <- 100
income2; taxes2 
## [1] 100
## [1] 100
taxes2 <- 30 
income2; taxes2 
## [1] 100
## [1] 30

Exercise 2.3.4

income2 <- taxes2 <- 100
income2; taxes2 
## [1] 100
## [1] 100
taxes2 <- 30 
income2; taxes2 
## [1] 100
## [1] 30

Exercise 2.4

height <- c(158, 170, 172, 181, 196)
weight <- c(45, 80, 62, 75, 115)

hw_data <- data.frame(height, weight)

Exercise 2.5

x <- 1:5
x <- 5:1
x <- c(1:5, 4:1)