Re: [R] all.equal() and which()

From: Patrick Burns <pburns_at_pburns.seanet.com>
Date: Sat 04 Feb 2006 - 22:40:40 EST

How about

which(abs(time(data) - 24.211) < 1e-7)

or the tolerance of your choice.

Patrick Burns
patrick@burns-stat.com
+44 (0)20 8525 0696
http://www.burns-stat.com
(home of S Poetry and "A Guide for the Unwilling S User")

tom wright wrote:

>Please excuse the lack of a complete dataset here, if its needed I'll be
>happy to provide it.
>Can anyone show me how to rewrite this?
>
>Browse[1]> time(data)[24210:24220]
>[1] 24.209 24.210 24.211 24.212 24.213 24.214 24.215 24.216 24.217
>[10] 24.218 24.219
>
>Browse[1]> which(time(data)==24.211)
>numeric(0)
>
>I'm assuming its an eps fault but
>which(all.equal(time(data),24.211))
>
>dosnt seem to work
>
>______________________________________________
>R-help@stat.math.ethz.ch mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>
>
>
>
>



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Sat Feb 04 23:02:30 2006

This archive was generated by hypermail 2.1.8 : Sun 05 Feb 2006 - 03:28:45 EST