Re: [R] merge two dataset and replace missing by 0

2010-11-15 Thread Kate Hsu
Thanks for all of your help. It works to me. Kate On Mon, Nov 15, 2010 at 10:06 AM, David Winsemius wrote: > > On Nov 15, 2010, at 10:42 AM, Kate Hsu wrote: > > Hi r users, >> >> I have two data sets (X1, X2). For example, >> time1<-c( 0, 8, 15, 22, 43, 64, 85, 106, 127, 148, 169, 190 ,21

Re: [R] merge two dataset and replace missing by 0

2010-11-15 Thread Gabor Grothendieck
On Mon, Nov 15, 2010 at 10:42 AM, Kate Hsu wrote: > Hi r users, > > I have two data sets (X1, X2). For example, > time1<-c( 0,   8,  15,  22,  43,  64,  85, 106, 127, 148, 169, 190 ,211 ) > outpue1<-c(171 ,164 ,150 ,141 ,109 , 73 , 47  ,26  ,15  ,12   ,6   ,2   ,1 ) > X1<-cbind(time1,outpue1) > >

Re: [R] merge two dataset and replace missing by 0

2010-11-15 Thread David Winsemius
On Nov 15, 2010, at 10:42 AM, Kate Hsu wrote: Hi r users, I have two data sets (X1, X2). For example, time1<-c( 0, 8, 15, 22, 43, 64, 85, 106, 127, 148, 169, 190 , 211 ) outpue1<-c(171 ,164 ,150 ,141 ,109 , 73 , 47 ,26 ,15 ,12 ,6 , 2 ,1 ) X1<-cbind(time1,outpue1) time2<-c(

Re: [R] merge two dataset and replace missing by 0

2010-11-15 Thread Uwe Ligges
See ?merge with argument all=TRUE and replace by 0 afterwards. Uwe Ligges On 15.11.2010 16:42, Kate Hsu wrote: Hi r users, I have two data sets (X1, X2). For example, time1<-c( 0, 8, 15, 22, 43, 64, 85, 106, 127, 148, 169, 190 ,211 ) outpue1<-c(171 ,164 ,150 ,141 ,109 , 73 , 47 ,26

[R] merge two dataset and replace missing by 0

2010-11-15 Thread Kate Hsu
Hi r users, I have two data sets (X1, X2). For example, time1<-c( 0, 8, 15, 22, 43, 64, 85, 106, 127, 148, 169, 190 ,211 ) outpue1<-c(171 ,164 ,150 ,141 ,109 , 73 , 47 ,26 ,15 ,12 ,6 ,2 ,1 ) X1<-cbind(time1,outpue1) time2<-c( 0 ,8 ,15 , 22 ,43 , 64 ,85 ,106 ,148) output2<-c(