> -----Original Message----- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf Of Tal Galili > Sent: Monday, August 10, 2009 2:14 PM > To: r-help@r-project.org > Subject: [R] Bug in "seq" (or a "feature") ? > > (I use R 2.9.1 with win XP) > > If I run this code: > seq(-0.1,.9, by = .05)[seq(-0.1,.9, by = .05) <= 0.5] > I get this output: > [1] -0.10 -0.05 0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 > Why is 0.50 not in the results ? > (It seems that it gives a slightly bigger number then 0.5 but I don't > understand why it does that) > > > Where as if I try: > seq(-0.1,.9, by = .05)[seq(-0.1,.9, by = .05) <= 0.4] > and get: > [1] -0.10 -0.05 0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 > Then 0.40 WILL be in the results. > > Thanks,Tal > >
This is another question for which the answer is FAQ 7.31. Hope this is helpful, Dan Daniel J. Nordlund Washington State Department of Social and Health Services Planning, Performance, and Accountability Research and Data Analysis Division Olympia, WA 98504-5204 ______________________________________________ R-help@r-project.org 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.