Re: [R] Logical operator fails to recognize vector element

2010-10-06 Thread Phil Spector
Here's a simple example that might be instructive: x = 9.790001 y = 9.79 x [1] 9.79 y [1] 9.79 x == y [1] FALSE abs(x - y) < 1e-8 [1] TRUE all.equal(x,y) [1] TRUE And as others have said, FAQ 7.31 . - Phil Spector

Re: [R] Logical operator fails to recognize vector element

2010-10-06 Thread Duncan Murdoch
See FAQ 7.31. Duncan Murdoch On 06/10/2010 12:02 PM, D. Alain wrote: Hi experts, I have encountered a strange phenomenon after loading spreadsheet data via >example<-read.csv("M:\\...\\mydata.csv",header=T) My data consist of two variables x and y which I have combined to a single vector u

Re: [R] Logical operator fails to recognize vector element

2010-10-06 Thread jim holtman
FAQ 7.31 On Wed, Oct 6, 2010 at 12:02 PM, D. Alain wrote: > Hi experts, > > I have encountered a strange phenomenon after loading spreadsheet data via > >>example<-read.csv("M:\\...\\mydata.csv",header=T) > > My data consist of two variables x and y which I have combined to a single > vector usi

[R] Logical operator fails to recognize vector element

2010-10-06 Thread D. Alain
Hi experts, I have encountered a strange phenomenon after loading spreadsheet data via >example<-read.csv("M:\\...\\mydata.csv",header=T) My data consist of two variables x and y which I have combined to a single vector using >z<-rowSums(cbind(example$x,example$y)) >z [1] 9.79 9.79 17.54 1