I have a set of data named ais. This data set is in the package sn in R. I used the following codes to read this data set:
library(sn)
data(ais)
attach(ais)
This data shows information (such as the gender, sport, height, weight, etc.) of 202 athletics.
I used tapply to draw the histograms of each sport (frequency of heights). My code is as follow:
par(mfrow = c(3, 4))
tapply(Ht,sport,hist)
The result of the codes are below pics:
My question is, how can I show/add the title of each sport (the name of the sport) on its corresponding histogram?
We can
splitthe data, and usemainas the names of thelist-output