Hi, is there an R function like sql's TOP key word?

 

I have a dataframe that has 3 columns: company, person, salary

 

How do I get top 5 highest paid person for each company, and if I have
fewer than 5 people for a company, just return all of them?

 

Thanks,

Richard

 


        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to