# 8 the “by” command does something to a variable, in groups based on another variable

by(iris$Sepal.Length, iris$Species, mean) #calculate mean Sepal.Length by species