I have two files and I want to make sure these two files are the same.
File 1:
df1<-read.table (text=" class type colour gender
12 1 yellow F
11 1 green M
14 2 red M
18 2 red F
16 1 red F
", header=TRUE)
File 2:
df2<-read.table (text=" class type colour gender
12 1 yellow F
11 2 gree M
14 2 red N
18 2 red F
18 1 red F
", header=TRUE)
As we can see in df2, there are four errors in columns. For example in df2, the class should read 16 as in df1, the class is 16 (last row), not 18. If the values in df1 and df2 are not equal, I want to get a FALSE and then see the number of errors. the outcome is: and the error=4. I have nearly 100 columns and so they are just a small sample of the data
out<-read.table (text=" class type colour gender
12 1 yellow F
11 FALSE FALSE M
14 2 red FALSE
18 2 red F
FALSE 1 red F
", header=TRUE)
Error =4
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…