Re: [R] Change negative values in column

2009-11-03 Thread Steve Lianoglou
Hi Joel, On Nov 3, 2009, at 11:30 AM, Joel Fürstenberg-Hägg wrote: > > However, I get the following error: > > > > Error in if (x[i] < 0) { : argument is of length zero > > This is telling you that x[i] is a zero length object, so you're > indexing is wrong > Doesn't x[i] means index i in vecto

Re: [R] Change negative values in column

2009-11-03 Thread Steve Lianoglou
Hi, On Nov 3, 2009, at 9:56 AM, Joel Fürstenberg-Hägg wrote: Hi all, I'm trying to write a script that changes all negative values in a data frame column to a small positive value, based on the the minimum value of the column. However, I get the following error: Error in if (x[i] < 0) {

[R] Change negative values in column

2009-11-03 Thread Joel Fürstenberg-Hägg
Hi all, I'm trying to write a script that changes all negative values in a data frame column to a small positive value, based on the the minimum value of the column. However, I get the following error: Error in if (x[i] < 0) { : argument is of length zero As well, I would "minimum