Basic Vectors (Vectors)
Cut and paste the following vector into your assignment and then use code to print the requested values related to the vector.
numbers <- c(5, 2, 26, 8, 16)
- The number of items in the
numbers
vector (using thelength
function) - The third item in the
numbers
vector (using[]
) - The smallest number in the
numbers
vector (using themin
function) - The largest number in the
numbers
vector (using themax
function) - The average of the numbers in the
numbers
vector (using themean
function) - The first, second and third numbers in the
numbers
vector (using[]
) - The sum of the values in the
numbers
vector (using thesum
function)