**Copy and paste the following code to your R Studio platform or R version:**

# The if statement

rnorm(1)

# creating a number derived from a sample that follows the

# normal distribution and that is the function of creating that

rnorm(10, mean = 0, sd = 1)

# here we define also the mean and the sttandard deviation desired

rm(answer)

x <- rnorm(1)

if (x > 1) {

answer <- “It is greater than 1 indeed!”

} else {

answer <- “It is less or equal to 1!”

}

print(answer)

# If else if statement –nested if statement

rm(answer)

x <- rnorm(1)

if (x > 1) {

answer <- “It is greater than 1 indeed!”

} else if (x >= -1) {

answer <- “It is between -1 and 1!”

} else {

answer <- “Less than -1!”

}

print(answer)