Session Ready
Exercise

Relational practice

In the video, Lore taught you all about different types of relational operators. For reference, here they are again:

  • > : Greater than
  • >=: Greater than or equal to
  • < : Less than
  • <=: Less than or equal to
  • ==: Equality
  • !=: Not equal

These relational operators let us make comparisons in our data. If the equation is true, then the relational operator will return TRUE, otherwise it will return FALSE.

apple <- 45.46
microsoft <- 67.88

apple <= microsoft
[1] TRUE
hello <- "Hello world"

# Case sensitive!
hello == "hello world"
[1] FALSE
Instructions
100 XP

micr and apple stock prices have been created for you.

  • Is apple larger than micr? Use >.
  • The != operator returns TRUE if two objects are not equal. Use != with apple and micr.

Two dates have been created for you.

  • Is tomorrow less than today?