尝试合并两个数据帧,使用名为hash_id
的变量。出于某种原因,R不能识别其中一个数据帧中的哈希ID,而在另一个数据帧中则是这样。WeiRd:R找不到值,但它只是
我查过了,我就是不明白。请参阅下面我如何检查:
> head(df1[46],1) # so I take the first 'hash-id' from df1
# hash_id
# 1 abab123123
> which(df2 == "abab123123", arr.ind=TRUE) # here it shows that row 6847 contains a match
# row col
# [1,] 6847 32`
> which(df1 == "abab123123", arr.ind=TRUE) # and here there is NO matching value!
# row col
#
可以用'dput'您展示一些重复的例子。例如。 'dput(head(df1,20)'或子集关联的行并输入它。另外,如果它是一个有多列的数据帧,最好使用'df1 [,“colName”] =='abab123123'' – akrun 2014-09-19 08:16:23