It seems like setequal compares column types while setdiff doesn't.
df1 <- data.frame(x=1)
df2 <- df1
# df1$x and df2$x are both of type `num`
setdiff(df1, df2) # --> will output 0-rowed data.frame
setequal(df1, df2) # --> will output TRUE
df2$x %<>% as.integer
# df1$x is of type `num` while df2$x is of type `int`
setdiff(df1, df2) # --> will output 0-rowed data.frame
setequal(df1, df2) # --> will output FALSE
I can see how this could actually be the intended behavior.
However, in that case a hint in the docs would be great.
It seems like
setequalcompares column types whilesetdiffdoesn't.I can see how this could actually be the intended behavior.
However, in that case a hint in the docs would be great.