Skip to main content

4.8) Summarizing Data


  • Use tapply() to find the median Dms value for GRASS plants with each number of Tlrs.
  • What happens if we name length as the function for the third argument of tapply()?
  • Use colMeans() to find the means of the columns of swiss. Check its help file and you’ll see some other useful summary functions. But there isn’t one for medians - so use apply() to find the medians of the columns.

At the end of this session, you are a master of square brackets! You should know:

  • several ways of referring to columns of data frames
  • how to refer to rows of data frames, including how to get subsets of data that meet specified conditions
  • some useful functions to summarise data frames; and
  • a bit about lists and arrays as well.