Re: [R] Replace query

2010-05-02 Thread David Winsemius
On May 2, 2010, at 7:01 AM, burgundy wrote: Hi, I'm trying to replace all values equal to 1 in one file (a) with the value in the corresponding column in a separate file (b). Example below. Any help (and brief notes if poss) much appreciated. Thanks!! file a: 0,0,1,1,0 1,0,0,0,1 0,0,0,0,0

Re: [R] Replace query

2010-05-02 Thread Tal Galili
The following code might work: a[a==1] <- b[a==1] But it depends on what a and b are exactly (vector, matrix, list, data.frame). Tal Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalil

[R] Replace query

2010-05-02 Thread burgundy
Hi, I'm trying to replace all values equal to 1 in one file (a) with the value in the corresponding column in a separate file (b). Example below. Any help (and brief notes if poss) much appreciated. Thanks!! file a: 0,0,1,1,0 1,0,0,0,1 0,0,0,0,0 1,0,1,1,0 file b: 3,4,6,8,11 output request: 0,