###Exercise 1### x <- 1 y <- 2 z <- 10 x + y + 2 * z x*x / y + 3 * z #here I gave two examples ###Exercise 2### space <- x + y + z space <- sum(c(x, y, z)) #here I gave two examples ###Exercise 3### n <- -4 n + x abs(n) + x ###Exercise 4### sequential_vector <- c(3:21) sequential_vector <- seq(3, 21) #here I gave two examples sequential_vector[2] * 3 sequential_vector * 4 length(sequential_vector) #to see how long the vector is for the following code. Pretending I am not working in Rstudio so I cannot see the environment sequential_vector[1:18] * 5 sequential_vector[-19] * 5 #here I gave two examples ###Exercise 5### three <- c(1, 2, 3) three_hundred <- rep(three, 100) ###Exercise 6### three_by_three <- matrix(c(rep(4, 3), 1:6), nrow = 3, byrow = F) three_by_three[ ,colSums(three_by_three)>10]