s-news
[Top] [All Lists]

Sorting dataframe

To: s-news@lists.biostat.wustl.edu
Subject: Sorting dataframe
From: Thom Burnett <Thom.Burnett@cognigencorp.com>
Date: Tue, 28 Sep 2004 16:45:22 -0400
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113
How do I sort a data.frame by columns when the direction of sorting changes from column to column.
The sort.col() function takes only a single direction.

As an example, I want to take a data frame with columns:
sex, race, smoking, weight

and sort by sex ascending, race descending, smoking descending, then weight ascending.

Is there a function available in SPlus 6.2 that does this in a single, straightforward step?



<Prev in Thread] Current Thread [Next in Thread>