Comparing two vectors in an if statement

前端 未结 3 1687
南方客
南方客 2020-12-06 04:15

I want put stop condition inside a function. The condition is that if first and second elements should match perfectly in order and length.

A <- c(\"A\",         


        
3条回答
  •  鱼传尺愫
    2020-12-06 04:28

    Are they identical?

    > identical(A,C)
    [1] FALSE
    

    Which elements disagree:

    > which(A != C)
    [1] 2 4
    

提交回复
热议问题