Which of the following can't be a variable name in R? 1. `` `if` `` 2. `_abc` 3. `var1` 4. `1stVar` #RStats #DataScience [TimeStamp:18072022123038]
2
13
6
0
0
Options: 1. 1st and 2nd 2. 2nd and 3rd 3. 2nd and 4th 4. 1st and 3rd
Correct Ans: 2nd and 4th. In R, a variable name cannot begin with `_` or digits and must only consists of letters, digits, `.` or `_`. There are reserved words also which can't be used for variable names, to check the whole list of #RStats #DataScience [TimeStamp:18072022220006]
@data_question 3. Variable names cannot start with neither underscore nor a number. 1st proposed name is valid because we can escape even reserved keywords with "``". 3rd proposed name is valid as well, variables can contain numbers.