To calculate the median of each column in a data frame in R, you would use the ______ function.

  • apply()
  • colMedian()
  • median()
  • colMeans()
To calculate the median of each column in a data frame in R, you would use the apply() function. By specifying the appropriate margin argument (2 for columns), you can apply the median() function across each column of the data frame.
Add your answer
Loading...

Leave a comment

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