s-news
[Top] [All Lists]

Problems with sort.col

To: "Splus Mailing List" <s-news@lists.biostat.wustl.edu>
Subject: Problems with sort.col
From: "Jonathan Dakin" <jdakin@overwey.demon.co.uk>
Date: Sun, 25 Jun 2006 08:52:09 +0100
Importance: Normal

Could anyone explain this ?

I've a dataframe I've been trying to order with respect to multiple columns.  However, if one of the columns is a date, I'm having problems.

Example:

eg <- data.frame("name"=c("smith", "smith", "jones"),
        "DOB"=dates(c("9/20/66", "3/21/66", "4/15/68")),
        stringsAsFactors=F)

Then
sort.col(eg, columns.to.sort="@ALL", columns.to.sort.by=c("name", "DOB"))

   name        DOB
3 jones 04/15/1968
2 smith 03/21/1966
1 smith 09/20/1966

No problem.  But:

sort.col(eg, columns.to.sort="@ALL", columns.to.sort.by=c("DOB", "name"))

Results in:

Problem in seq: argument along= not matched: seq(along = ..1)
Use traceback() to see the call stack

This is not the only error I've had, a similar request resulted in:

Problem in rle(values.to.sort.by[values.order]): Argument must have an atomic mode
Use traceback() to see the call stack

Is there something very obvious I'm missing ?  Or is there a bug ?  Any help much appreciated.  I'm using Splus 6.1 under W2K.

Jonathan Dakin


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