Choice Operators


  1. Create the following variables:
     w <- 10.2
     x <- 1.3
     y <- 2.8
     z <- 17.5
     colors <- c("red", "blue", "green")
     masses <- c(45.2, 36.1, 27.8, 81.6, 42.4)
     dna1 <- "attattaggaccaca"
     dna2 <- "attattaggaacaca"
    
  2. Use them to print whether or not the following statements are TRUE or FALSE.
    • a) w is greater than 10
    • b) "green" is in colors
    • c)x is greater than y
    • d)Each value in masses is greater than 40.
    • e)2 * x + 0.2 is equal to y
    • f)dna1 is the same as dna2
    • g)dna1 is not the same as dna2
    • h)w is greater than x, or y is greater than z
    • i)x times w is between 13.2 and 13.5
    • j) Each mass in masses is between 30 and 50.