1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to R

Exercise

Basic data types in R

R works with numerous data types. Some of the most basic types to get started are:

  • Decimal values like 4.5 are called numerics.
  • Whole numbers like 4 are called integers. Integers are also numerics.
  • Boolean values (TRUE or FALSE) are called logical.
  • Text (or string) values are called characters.

Note how the quotation marks in the editor indicate that "some text" is a string.

Instructions

100 XP

Change the value of the:

  • my_numeric variable to 42.
  • my_character variable to "universe". Note that the quotation marks indicate that "universe" is a character.
  • my_logical variable to FALSE.

Note that R is case sensitive!