To calculate the median of each row in a matrix in R, you would use the ______ function.

  • rowMedian()
  • colMedian()
  • median()
  • apply()
To calculate the median of each row in a matrix in R, you would use the rowMedian() function. However, note that the rowMedian() function is not available in base R. You can use the apply() function with the margin argument set to 1 to calculate the median of each row.
Add your answer
Loading...

Leave a comment

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