I wrote the following function to get the histogram for more than one variable, it works, but it doesn't display the header even though I have used the main
argument.
lapply(c("avg_ed","api00","api99"), function(s){hist(mydata[s],main="Histogram of [s]")})
dataset used: http://www.math.montana.edu/~jimrc/classes/stat408/data/elemapi.csv