Skip to content

Instantly share code, notes, and snippets.

@duttashi
Created August 6, 2017 07:34
Show Gist options
  • Save duttashi/b19ad40fcec2128cfc0abed72736984a to your computer and use it in GitHub Desktop.
Save duttashi/b19ad40fcec2128cfc0abed72736984a to your computer and use it in GitHub Desktop.
To merge two data frames on common columns in R
# Method 1
# Merge these four separate data frame into a single table on SCHCD
x.data<- join(enrolrep.data, facilty.data, by=c("SCHCD"))
y.data<- join(basic.data, x.data, by=c("SCHCD"))
master.data<- join(x.data, teachr.data, by=c("SCHCD"))
# Method 2: using setDT() of data.table(). I have to find out how its done in setDT()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment