Re: [R] merge question

2014-06-30 Thread Dr Eberhard W Lisse
Rolf, I hear you. But, after reflection, ie I looked at my situation again, it is great :-)-O el Sent from Dr Lisse's iPad mini > On Jun 30, 2014, at 0:48, Rolf Turner wrote: > > >> On 30/06/14 10:32, Dr Eberhard W Lisse wrote: >> >> Thanks, >> >> I then set NA to 0, and can do the sutr

Re: [R] merge question

2014-06-29 Thread Dr Eberhard W Lisse
Thank you very much. el On 2014-06-30, 00:48 , Rolf Turner wrote: > > On 30/06/14 10:32, Dr Eberhard W Lisse wrote: > >> Thanks, >> >> I then set NA to 0, and can do the sutraction, >> >> great. > > Not so great. I haven't gone through the issues underlying this post, > but replacing NA by 0

Re: [R] merge question

2014-06-29 Thread Rolf Turner
On 30/06/14 10:32, Dr Eberhard W Lisse wrote: Thanks, I then set NA to 0, and can do the sutraction, great. Not so great. I haven't gone through the issues underlying this post, but replacing NA by 0 will almost surely yield nonsense. "Missing" is ***not*** the same thing as "zero". Pr

Re: [R] merge question

2014-06-29 Thread Dr Eberhard W Lisse
Thanks, I then set NA to 0, and can do the sutraction, great. el On 2014-06-29, 22:32 , Michael Peng wrote: > you can get a new data frame by > merge(qpiso, qplegit, all.x = TRUE, all.y = TRUE, by = "iso" ) > Take the subtraction on the new data frame. > > > > > 2014-06-29 11:24 GMT-05:00

Re: [R] merge question

2014-06-29 Thread Michael Peng
you can get a new data frame by merge(qpiso, qplegit, all.x = TRUE, all.y = TRUE, by = "iso" ) Take the subtraction on the new data frame. 2014-06-29 11:24 GMT-05:00 Dr Eberhard Lisse : > I have two data frames like so > > > qpiso > iso requests > 1A1 20 > 2A2 199 > 3

Re: [R] merge question

2014-06-29 Thread Jeff Newmiller
If you really prefer solution code, then provide reproducible example code as the footer requests. Use ?merge with the all.x=TRUE parameter, and then perform your calculations on the resulting combined data frame, using ?ifelse and ?is.na as needed. --

[R] merge question

2014-06-29 Thread Dr Eberhard Lisse
I have two data frames like so > qpiso iso requests 1A1 20 2A2 199 3AD5 4AE 176 ... 189 ZW 82 > qplegit iso requests 1A2 36 2AE4 3AM2 4AO1 ... 100 ZW3 I want to create another dataframe

Re: [R] Merge question

2009-02-26 Thread Marc Schwartz
on 02/26/2009 11:52 AM Vadlamani, Subrahmanyam {FLNA} wrote: > Hi: > I am a new R user. I have the following question and would appreciate your > input > > Data1 (data frame 1) > p1,d1,d2 (p1 is text and d1 and d2 are numeric) > xyz,10,25 > > Data2 (data frame 2) > p1,d1,d2 > xyz,11,15 > > Now

Re: [R] Merge question

2009-02-26 Thread milton ruser
Hi there, something like this? Data1<-read.table(stdin(), head=T, sep=",") p1,d1,d2 xyz,10,25 kmz,100,250 Data2<-read.table(stdin(), head=T, sep=",") p1,d1,d2 xyz,11,15 kmz,110,150 Data1 Data2 Data3<-data.frame(rbind(Data1,Data2)) Data3 Data3.sum<-aggregate(Data3[,c("d1","d2")], list(Data3$p1)

[R] Merge question

2009-02-26 Thread Vadlamani, Subrahmanyam {FLNA}
Hi: I am a new R user. I have the following question and would appreciate your input Data1 (data frame 1) p1,d1,d2 (p1 is text and d1 and d2 are numeric) xyz,10,25 Data2 (data frame 2) p1,d1,d2 xyz,11,15 Now I want to create a new data frame that looks like so below. The fields d1 and s2 are su