Error message

  • Deprecated function: The each() function is deprecated. This message will be suppressed on further calls in book_prev() (line 775 of /home3/gardeoi3/public_html/iamrandom/modules/book/book.module).
  • Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters in drupal_get_feeds() (line 394 of /home3/gardeoi3/public_html/iamrandom/includes/common.inc).

Function: ordering

This function will sort a dataframe by the column number specified.
First cbind() your variables together and then sort by one column.

ordering=function(dataset, col.num)
{   index=order(dataset[,col.num])
    hold=0
    dataset=dataset[index,]  
    dataset
}

### Example:
# turtles=cbind(w,f,y)
# ordering(turtles, 3)
 

Tags: