Re: [R] Odp: Data manipulation question

2007-10-10 Thread Petr PIKAL
Petr PIKAL/CTCAP napsal dne 10.10.2007 15:03:28: > [EMAIL PROTECTED] napsal dne 10.10.2007 13:55:32: > > > Hi Petr, > > > > > d$z<-NA > > > d$z[d$x %in% d$id] <- d$y[d$id %in% d$x] > > > > > > works in this particular case but it means you do not have multiple same > > > ids and X > > > > Tha

Re: [R] Odp: Data manipulation question

2007-10-10 Thread Petr PIKAL
[EMAIL PROTECTED] napsal dne 10.10.2007 13:55:32: > Hi Petr, > > > d$z<-NA > > d$z[d$x %in% d$id] <- d$y[d$id %in% d$x] > > > > works in this particular case but it means you do not have multiple same > > ids and X > > Thanks for the idea. But the problem is that I can have multiple > ids... >

Re: [R] Odp: Data manipulation question

2007-10-10 Thread Julien Barnier
Hi Petr, > d$z<-NA > d$z[d$x %in% d$id] <- d$y[d$id %in% d$x] > > works in this particular case but it means you do not have multiple same > ids and X Thanks for the idea. But the problem is that I can have multiple ids... In fact in the meantime I found a solution by using row names : R> d

[R] Odp: Data manipulation question

2007-10-10 Thread Petr PIKAL
Hi [EMAIL PROTECTED] napsal dne 10.10.2007 12:10:29: > Hi all, > > Suppose I have the following data.frame, with an id column and two > variables columns : > > idX Y > 0001 NA 21 > 0002 NA 13 > 0003 000145 > 0004 NA 71 > 0005 000320