Nulls in Vectors (Vectors)

Cut and paste the following vector into your assignment. 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 when doing calculations (but not when finding the values at different positions or determining the lenght of the vector).

numbers <- c(7, 6, 22, 5, NA, 42)
  1. The smallest number in the numbers vector
  2. The average of the numbers in the numbers vector
  3. The length of the numbers vector (including the NA)
  4. The sum of the values in the numbers vector
  5. The second value in numbers
  6. The largest number in the numbers vector
Expected outputs for Nulls in Vectors