From csardi.gabor at gmail.com  Sat Jan  4 01:24:07 2014
From: csardi.gabor at gmail.com (=?ISO-8859-1?B?R+Fib3IgQ3PhcmRp?=)
Date: Fri, 3 Jan 2014 19:24:07 -0500
Subject: [Rd] wishlist: decreasing argument to is.unsorted
In-Reply-To: <52C70433.20809@pburns.seanet.com>
References: <52C70433.20809@pburns.seanet.com>
Message-ID: <CABtg=KkRH-BRQsEcBcFwU6saa_fUYbpwDkaiRx=7yjA6hdanvw@mail.gmail.com>

While we are here, how about an is.sorted() function? It is trivial
and helps readability a lot imho. Then one does not have to write
things like

stopifnot(!is.unsorted(x))

but can write

stopifnot(is.sorted(x))

instead.

Gabor

On Fri, Jan 3, 2014 at 1:40 PM, Patrick Burns <pburns at pburns.seanet.com> wrote:
>
> I've just realized that it could be handy
> to have a 'decreasing' argument in 'is.unsorted'.
>
> And I'm cheekily hoping someone else will
> implement it.
>
> It is easy enough to work around (with 'rev'),
> but would be less hassle with an argument.
> The case I have in mind uses 'is.unsorted' in
> 'stopifnot'.
>
> Pat
>
> --
> Patrick Burns
> pburns at pburns.seanet.com
> twitter: @burnsstat @portfolioprobe
> http://www.portfolioprobe.com/blog
> http://www.burns-stat.com
> (home of:
>  'Impatient R'
>  'The R Inferno'
>  'Tao Te Programming')
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



[Rd] wishlist: decreasing argument to is.unsorted
=?ISO-8859-1?B?R+Fib3IgQ3PhcmRp?=