Re: [R] For loop for distinguishing negative numbers

2009-07-16 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 15.07.2009 17:59:39: > > see ?ifelse > > you didn't specify what happens if a value is exactly zero in the dataset > and so i've just bundled it in with the negative case: > > x <- rnorm(20, 0, 1) > y<-ifelse(x<=0, 10, 5) For this simple case you ca

Re: [R] For loop for distinguishing negative numbers

2009-07-15 Thread tonybreyal
see ?ifelse you didn't specify what happens if a value is exactly zero in the dataset and so i've just bundled it in with the negative case: x <- rnorm(20, 0, 1) y<-ifelse(x<=0, 10, 5) HTH, Tony Breyal cmga20 wrote: > > Hi i am very new to R and I have been trying to change each individual