4.8) Summarizing Data
- Use
tapply()
to find the medianDms
value forGRASS
plants with each number ofTlrs
. - What happens if we name
length
as the function for the third argument oftapply()
? - Use
colMeans()
to find the means of the columns ofswiss
. Check its help file and you’ll see some other useful summary functions. But there isn’t one for medians - so useapply()
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.