Choice Operators with Vectors (Making Choices)

Create the following variables.

masses <- c(45.2, 36.1, 27.8, 81.6, 42.4)
counts <- c(26, 20, 12, 32, 16)
heights <- c(5.6, 3.9, NA, 8.6, 39.2)

Use them to print whether or not the following statements are TRUE or FALSE.

  1. Each value in masses is greater than 40.
  2. Each mass in masses is between 30 and 50.
  3. Each value in counts is not equal to 26.
  4. Either the value in masses is greater than 42 or the value in counts is less than 20.
  5. Each value in heights is NA.
  6. Each value in heights is greater than 6.
Expected outputs for Choice Operators with Vectors