I've created a vector for age,
age <- c(18, 21, 22, 17, 19, 19, 20)
and also a vector for names.
name <- c("Emily", "John", "Michael", "Alex", "Olivia", "Sophia", "Noah")
The names correspond to the ages. I am supposed to find the people who are older than 18. I know how to return for who has the youngest age through
name[which.min(age)]
which returns Alex, but I'm stuck on how to get everyone who is older than 18 (which should be everyone except for Alex). Thanks!