From ripley@stats.ox.ac.uk  Fri Aug 16 07:34:47 2002
From: ripley@stats.ox.ac.uk (ripley@stats.ox.ac.uk)
Date: Fri, 16 Aug 2002 07:34:47 +0100 (BST)
Subject: order(1, na.last=NA) fails (PR#1913)
In-Reply-To: <200208152028.WAA00080@pubhealth.ku.dk>
Message-ID: <Pine.LNX.4.31.0208160733080.25058-100000@gannet.stats>

True, but you should really be using sort.list on a single vector.
Fixed now.

On Thu, 15 Aug 2002 brahm@alum.mit.edu wrote:

>
> R> order(1, na.last=NA)
> Error in apply(sapply(z, is.na), 1, any) :
> 	dim(X) must have a positive length
>
> This bug appears unrelated to PR#1906, and so the fix of 8/15 doesn't help.
> It comes from the line inside order():
>
>    ok <- !apply(sapply(z, is.na), 1, any)
>
> where z=list(1) in my example.  sapply() returns a single-element vector, not a
> matrix, making apply() unhappy.  This might work better:
>
>    nas <- sapply(z, is.na)
>    ok <- if (is.matrix(nas)) !apply(nas, 1, any) else !any(nas)
>
> -----------------------------------------------------------------------------
>
> Version:
>  platform = sparc-sun-solaris2.6
>  arch = sparc
>  os = solaris2.6
>  system = sparc, solaris2.6
>  status =
>  major = 1
>  minor = 5.1
>  year = 2002
>  month = 06
>  day = 17
>  language = R
>
> Search Path:
>  .GlobalEnv, package:misc, package:io, package:arrays, package:ls1, package:g.data, package:db, package:ts, package:ctest, Autoloads, package:base
>
> --
>                               -- David Brahm (brahm@alum.mit.edu)
>
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


order(1, na.last=NA) fails (PR#1913)
ripley@stats.ox.ac.uk