Mean mm by city.
Goal
Print 81.7 mean mm and Kisumu as wettest.
df <- data.frame(
city = c("Nairobi", "Mombasa", "Kisumu", "Nakuru", "Eldoret"),
mm = c(85, 40, 120, 60, 90),
stringsAsFactors = FALSE
)
print(mean(df$mm))
print(df$city[which.max(df$mm)])
print(df[order(-df$mm), ])