Variables in R
Variables
are used to store data, whose value can be changed according to our. To define
the inputs or entity we have to give name our variables. To do so we have to
follow certain rules for defining variables as in below:-
Naming
Convension
- alllowercase: e.g. dataframes
- period.separated: e.g. firstname.lastname
- underscore_separated: e.g. data_frames
- lowerCamelCase: e.g. dFrame
- UpperCamelCase: e.g. CalculateAge
Constants
in R
- Numeric Constants: It can be checked with the typeof() function. e.g. typeof(5)
- Character Constants : single quotes (') or double quotes (") e.g. typeof("abc")
- Built-in Constants: LETTERS,letters,pi,month.name etc e.g. letters[1:5]
[1] "a" "b"
"c" "d" "e" UpperCamelCase: e.g. CalculateAge
Variables in R
Reviewed by Rupesh
on
01:20
Rating:
No comments: