Suppose you're given a numeric vector in R and asked to calculate its median. How would you do it?

  • Use the median() function with the vector as an argument
  • Use the mean() function with the vector as an argument
  • Use the sum() function with the vector as an argument
  • Use the mode() function with the vector as an argument
To calculate the median of a numeric vector in R, you would use the median() function with the vector as an argument. The median() function returns the middle value when the vector is sorted in ascending order.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *