Variable Names (Identifiers) - R (Variable Names) Flashcards

1
Q

29) Rules for R variables are:
A variable name must start with a letter and can be a combination of letters, digits, period(.) and underscore(_). If it starts with period(.), it cannot be followed by a digit.

A

Legal Variable Names

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

30) Rules for R variables are: A variable name cannot start with a number or underscore (_)

A

Illegal 8 or _

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

31) Rules for R variables are: Variable names are case-sensitive (age, Age and AGE are three different variables)

A

(age, Age and AGE) !=

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

32) Rules for R variables are: Reserved words cannot be used as variables (TRUE, FALSE, NULL, if…)

A

Illegal (TRUE, FALSE, NULL, if…)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

33) Forbidden Names (Illegal) for R variables are:

A

2myvar, my-var, my var, _my_var,
my_v@ar, TRUE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

34) Remember that variable names are case-sensitive!

A

(age, Age and AGE) !=

How well did you know this?
1
Not at all
2
3
4
5
Perfectly