嗨,我无法合并非结构化的csv文件。下面是我的代码:
file1 = read.csv("fileone.csv",header=TRUE,skip=0)
file2 = read.csv("filetwo.csv",header=TRUE,skip=0)
我有类似这样的数据集:
Data:file1 Date:file2
City State City State
Boston MA Dallas TX
Seattle WA Lowell MA
Miami FL
Chicago IL
我想要这样的结果:
MergedData
City State
Boston MA
Seattle WA
Miami FL
Chicago IL
Dallas TX
Lowell MA
答案 0 :(得分:1)
尝试一下:
mergedFile =merge(file1,file2,all=TRUE,sort=FALSE)