Nulls in Vectors


Cut and paste the following vector into your script. Then use code to print the requested values related to the vector. You’ll need to use na.rm = TRUE to ignore the null values.

numbers <- c(7, 6, 22, 5, NA, 42)
  1. The smallest number in the numbers vector
  2. The largest number in the numbers vector
  3. The average of the numbers in the numbers
  4. The sum of the values in the numbers vector