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]]

