Naming

In the previous lessons, we've been naming variables with an eye for what is appropriate for R. There are some hard and fast rules when it comes to naming objects, so let's go over these here. All variable names must:

  • Start with a letter
  • Only contain letters, numbers, the underscore symbol, and periods

As such the names: a1, b_2, c.d are all okay. However names such as 1a, _b2, df-c are all no-goes.

Try commenting out any of the lines below and see what happens.