(x<-names(df1
(df_finel<-subset(df2,,x
df1 <- list(a = 1, b = "c", c = 1:3)
df2 <- list(v = 2, c = 1:3, h = "h")
names(df1)
names(df2)
df <- df2[which(names(df2)%in%names(df1))]
df
--
You received this message because you are subscribed to the Google Groups "Israel R User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to israel-r-user-g...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
This email has been checked for viruses by Avast antivirus software.
|
This time with data frames:
df1 <- data.frame(a = 1, b = "c", c = 1:3)
df2 <- data.frame(v = 2, c = 1:3, h = "h")
names(df1)
names(df2)
df <- df2[which(names(df2)%in%names(df1))]
df
From: Ofrit Lesser [mailto:ofrit....@gmail.com]
Sent: Wednesday, 7 October 2015 8:21 AM
To: 'israel-r-...@googlegroups.com'
Subject: RE: [Israel RUG] select by names(df)
df1 <- list(a = 1, b = "c", c = 1:3)
df2 <- list(v = 2, c = 1:3, h = "h")
names(df1)
names(df2)
df <- df2[which(names(df2)%in%names(df1))]
df
From: israel-r-...@googlegroups.com [mailto:israel-r-...@googlegroups.com] On Behalf Of ???? ????
Sent: Wednesday, 7 October 2015 7:40 AM
To: Israel R User Group
Subject: [Israel RUG] select by names(df)
שלום לכולם
--
You received this message because you are subscribed to the Google Groups "Israel R User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to israel-r-user-g...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to israel-r-user-group+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.