This is Practice: Data Types, checked by tests.

Create five variables, one of each basic data type, and print the class of each with class(), in this order:

  1. my_character: some text in quotes
  2. my_numeric: a number with a decimal point
  3. my_integer: a whole number written with an L suffix, like 7L
  4. my_logical: TRUE or FALSE
  5. my_complex: a complex number, like 2+3i

Your output should be:

[1] "character"
[1] "numeric"
[1] "integer"
[1] "logical"
[1] "complex"

Why does 7 on its own give "numeric", not "integer"? Try it and see.

You do not have permission to attempt this activity.