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
[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...
>
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
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
4 matches
Mail list logo