check whether all elements of a list are in equal in R

前端 未结 5 629
挽巷
挽巷 2021-01-02 09:34

I have a list of several vectors. I would like to check whether all vectors in the list are equal. There\'s identical which only works for pairwise comparison.

5条回答
  •  误落风尘
    2021-01-02 10:37

    this also works

    m <- combn(length(test_true),2)
    
    for(i in 1:ncol(m)){
        print(all(test_true[[m[,i][1]]] == test_true[[m[,i][2]]]))
        }
    

提交回复
热议问题