I am trying to get the top \'n\' companies from a data frame.Here is my code below.
data(\"Forbes2000\", package = \"HSAUR\") sort(Forbes2000$profits,decreas
Use order to sort the data.frame, then use head to get only the first 50 rows.
order
data.frame
head
data("Forbes2000", package = "HSAUR") head(Forbes2000[order(Forbes2000$profits, decreasing=TRUE), ], 50)