Merging large two or three datasets with R

#1
Hi There,

I'm very new in the R, and it's the first my post.
I have several large datasets in excel (and also in text file), composed of 12 columns and about 50,000 rows. The column name is the same in different datasets, however, the cell contents not. I would like to merge several dataset into single dataset. I have heared that there is a way in R to this end, but I have no idea what I should do. Could you please help me out on this issue?

Thanks a lot in advance
 
#2
you use the cbind command. Select a column that the two dataset share (or create your own numerically) and then bind them by that

Here is some recent code I used for just this purpose-
money = read.csv("E:/mydata/stat/money.csv",header=TRUE)
names(money)[1]="DISTRICTNUMBER"
l = seq(from=2,to=2*length(money$DISTRICTNUMBER),by=2)
DIS = unlist(strsplit(as.character(money$DISTRICTNUMBER), split="'", fixed=TRUE))[l]
DIS = as.numeric(DIS)
money$DISTRICTNUMBER=DIS
money$rule = paste(money$DISTRICTNUMBER,money$year,sep="-")

race = read.csv("E:/mydata/stat/race.csv",header=TRUE)
names(race)[1]="DISTNAME"
names(race)[3]="DISTRICTNUMBER"
race$rule = paste(race$DISTRICTNUMBER,race$year,sep="-")

## 2. delete the cases that only money has.

dif1 = setdiff(money$rule,race$rule)
for(i in 1:length(dif1)){
money = money[money$rule!=dif1,]
}


## 3. delete the cases that only race has.

dif2 = setdiff(race$rule,money$rule)
for(i in 1:length(dif2)){
race = race[race$rule!=dif2,]
}

money = money[,1:249]
race = race[,1:23]
## 4. Merge the two dataset
money = money[order(money$DISTRICTNUMBER,money$year),]
race = race[order(race$DISTRICTNUMBER,race$year),]