Exercise 4-6

  • For…
  • as.logical(x+y), uses the logic of TRUE + FALSE = TRUE
  • as.logical(x*y), uses the logic of TRUE * FALSE = FALSE
  • as.logical(1 - x), is the inverse of x
  • as.logical(x!=y), returns true if x and y have the same different values.