r - TRUE and FALSE as boolean versus same as characters -


this question has answer here:

could elaborate on, going on here:

a = "true" b = true #[1] "true" b #[1] true str(a) #chr "true" str(b) #logi true == b #[1] true 

this true string "true" in e.g.:

"string" == true #[1] false 

so not because non-empty string true en e.g. perl, therefore have expected true == "true" yield false?

to quote ?comparison in files:

if 2 arguments atomic vectors of different types, 1 coerced type of other, (decreasing) order of precedence being character, complex, numeric, integer, logical , raw.

r automatically coercing values down resulting in

"true" == true # [1] true 1 == true # [1] true 

etc.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -