当前位置:网站首页>Why is true == "true" true in R- Why TRUE == “TRUE” is TRUE in R?

Why is true == "true" true in R- Why TRUE == “TRUE” is TRUE in R?

2022-06-25 07:11:00 Technology feast

problem :

  1. Why TRUE == "TRUE" is TRUE in R? Why? TRUE == "TRUE" stay R Medium is TRUE
  2. Is there any equivalent for === in R? stay R There is === Equivalent ?

Update: to update :

These are all returning FALSE : These all return FALSE

TRUE == "True"TRUE == "true"TRUE == "T"

The only TRUE value is TRUE == "TRUE" . Unique TRUE The value is TRUE == "TRUE" .

In case of checking with identical() everything works fine. In the use of identical() Check the case , Everything is all right .

Second Update: Second update :

By === operator I meant the process of checking the Value and the Data Type of a variable .=== The operator refers to checking Variable Of value and data type The process of .In this case I assumed that the == operator will only compare the Values of variables, not their Data Type as well. under these circumstances , I am assuming that == Operator only compares the value , Not their data type .


Solution :

Reference resources : https://stackoom.com/en/question/10eUx
原网站

版权声明
本文为[Technology feast]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202201234217532.html