[R] Interweaving of two datasets

Rui Barradas ruipbarradas at sapo.pt
Fri May 11 01:06:28 CEST 2012


Hello,

>
> I'm very frightened to lose datas or make mistakes
>
You wont lose rows, don't worry.

Two notes: merge uses the common columns in both data.frames, so by.x and
by.y aren't
really needed but they wont hurt.
And second, from the help page for 'attach', "attach can lead to confusion.
" That's why I've used 'with'
See it's help page

?with

(Or the way it was used.)

Rui Barradas

lunarossa wrote
> 
> I tried to do using merge, I think now it works (anyway it is your worth),
> I wrote:
> 
> df1<-read.csv("df1.csv",head=T)
> attach(df1)
> df2<-read.csv("df2.csv",head=T)
> attach(df2)
> join<-merge(df1,df2,by.x="name",by.y="name")
> 
> Is it correct? Coz I'm very frightened to lose datas or make mistakes 
> 


--
View this message in context: http://r.789695.n4.nabble.com/Interweaving-of-two-datasets-tp4608505p4624958.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list