R – How dare you use “==” in if statement

There are usually so many places in each language that just don’t make that much sense but so easy for an inexperienced programmer to adopt and take for granted.

“==” in R is such a thing. I came from a Python programming background and I take for granted that to use “==” in an if statement whenever comparing two objects based on value.

However, in R, I just noticed that even in the documentation of “==”, they clearly write down a misunderstanding of “==” will lead to a disaster.

r_equal

One thought on “R – How dare you use “==” in if statement

  1. “a unexperienced” don’t you mean “an inexperienced” and “in a if statement” don’t you mean “in an if statement” ?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s