title: Ranking multiple columns in R
body: <p>cI have the following dataframe: </p>
  
  <pre><code> teamID X3M   TR   AS  ST  BK  PTS       FGP       FTP
     1    423 2884 1405 585 344 5797 0.4763141 0.7370821
     2    467 2509  868 326 200 6159 0.4590164 0.7604167
     3    769 1944 1446 614 168 6801 0.4248021 0.7825521
     4    814 2457 1596 620 308 8058 0.4348856 0.8241445
     5    356 2215 1153 403 243 4801 0.4427576 0.7478921
     6    302 3360 1151 381 393 6271 0.4626974 0.6757176
     7    384 2318 1070 431 269 5225 0.4345146 0.7460317
     8    353 2529 1683 561 203 6150 0.4537273 0.7344740
     9    598 2384 1635 497 162 6439 0.4512104 0.7998392
    10    502 3191 1898 525 337 7107 0.4598565 0.7836970
  </code></pre>
  
  <p>I want to produce a dataframe like this:</p>
  
  <pre><code> teamID rank_X3M rank_TR rank_AS rank_ST rank_BK rank_PTS rank_FGP rank_FTP
     1    5
     2    6
     3    9
     4    10
     5    3
     6    1
     7    4
     8    2
     9    8
    10    7
  </code></pre>
  
  <p>I tried apply(-df[,c(2:9)], 1, rank, ties.method='min') and got this</p>
  
  <pre><code>     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
  X3M    4    4    5    4    4    6    4    4    5     6
  TR     2    2    2    2    2    2    2    2    2     2
  AS     3    3    3    3    3    3    3    3    3     3
  ST     5    5    4    5    5    4    5    5    4     5
  BK     6    6    6    6    6    5    6    6    6     4
  PTS    1    1    1    1    1    1    1    1    1     1
  FGP    8    8    8    8    8    8    8    8    8     8
  FTP    7    7    7    7    7    7    7    7    7     7
  </code></pre>
  
  <p>Any suggestions about what to try next? Thanks! </p>