> str(a)
Named int [1:5] 0 0 0 0 0
- attr(*, "names")= chr [1:5] "Var2" "Var3" "Var4" "Var5" ...
> str(b)
Named int [1:5] 0 0 0 0 0
- attr(*, "names")= chr [1:5] "Var1" "Var2" "Var3" "Var4" ...
> identical(a,b)
[1] FALSE
我意识到identical
不仅要比较向量内容,还要比较名称。
如何避免名称检查而不手动删除它们?