Using the mtcar dataset I want to find the top 2 cars with the highest mileage and after knowing that information I want to create a new data frame that has info of only those 2 cars with all the remaining info like horsepower, gear, cylinder, and so on. Please let me know how could I do that
cars<-mtcars %>%
group_by(mpg) %>%
count(mpg)
So with this, I get 32.9 and 32.4 as best mpg now how do I add all the other info in a new data frame that has info about these 2 cars. Please let me know. Thank you!