[R] seq unexpected behavior

From: Vries, Han de <hdevries_at_prgs.edu>
Date: Thu 27 Jul 2006 - 11:35:26 EST


seq(0.1, 0.9 - 0.8, by = 0.1) gives the following error message:

Error in seq.default(0.1, 0.9 - 0.8, by = 0.1) :

        wrong sign in 'by' argument

but seq(0.1, 0.8 - 0.7, by = 0.1) gives
[1] 0.1
(no error message)

Why do I get an error message in the first case? Han

> sessionInfo()

R version 2.2.1, 2005-12-20, i386-pc-mingw32

attached base packages:
[1] "methods" "stats" "graphics" "grDevices" "utils" "datasets"
[7] "base"

(NB I also tried version 2.3.1 and got the same result - both versions are precompiled)   

> Sys.getlocale()

[1] "LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United
States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252"


This email message is for the sole use of the intended recip...{{dropped}}



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 and provide commented, minimal, self-contained, reproducible code. Received on Thu Jul 27 11:44:31 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 27 Jul 2006 - 12:17:57 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.