At Tue, 1 Jan 2013 02:00:14 +0000,
Muhuri, Pradip (SAMHSA/CBHSQ) wrote:
> Although David's solution (putting the right parenthesis, which I had missed) 
> has resolved the issue, I would like to try yours as well.
> 
> Could you please clarify the six elements:  c(-1e-8, 0, 0, 0, 0, 1e8)?

It's a vector.  Floating point numbers can't always store an exact
representation.  So, for instance, R evaluates ".1 == .3 / 3" as
FALSE.  If instead you had done: "abs(.1 - .3 / 3) < 1e-8", the result
would be true.  The latter does not check for strict equality, but
whether the value is within some small delta of the target.  Read
chapter 1 of the R Inferno.

Note, the last element of the vector should be 1e-8, not 1e8.

Neal

______________________________________________
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.

Reply via email to