Question 1

x <- c(1.1)
x
## [1] 1.1
a <- c(2.2)
a
## [1] 2.2
b <- c(3.3)
b
## [1] 3.3
z <- x^a^b
z
## [1] 3.61714
z <- (x^a)^b
z
## [1] 1.997611
z <- 3*x^3+2*x^2+1
z
## [1] 7.413

Question 2

#Question 2
#a
q <- c(rep(1:8), rep(7:1))        
#b
z <- rep(1:5, c(1,2,3,4,5))
#c
x <- rep(5:1, c(1,2,2,4,5))

Question 3

x <- runif(1,1,10)
y <- runif(1,1,20)
r <- sqrt(x^2+y^2)
t <- (atan(y/x))

Question 4

queue <- c("sheep", "fox", "owl", "ant") 
queue <- c(queue, "serpent")
queue <- queue [queue!="sheep"]
queue <- c("donkey", queue)
queue <- queue [-5]
queue <- queue[-3]
queue <- append(queue, "aphid", after = 2)
which(queue == "aphid")
## [1] 3

Question 5

x <- rep(1:100)
y <- which(x %% 2 !=0 & x %% 3 !=0 &x %% 7 !=0)
y
##  [1]  1  5 11 13 17 19 23 25 29 31 37 41 43 47 53 55 59 61 65 67 71 73 79 83 85
## [26] 89 95 97
#y <- seq(1:100) %>%  filter(x %% 2 !=0 & x %% 3 !=0 &x %% 7 !=0) #tidyverse isn't working with me today but I want to keep the code since I work in tidyverse