Professional Documents
Culture Documents
Some References
• Commands can be grouped together using curly • Comments start with a hash “#”
brackets - “{” and “}”
Basic concepts Basic concepts
• Objects are accessed by names
• R has reserved words which may not be
Object names can be composed of letters, used as object names
digits, or period “.”
one-letter reserved words: c, q, s, t, C, D, F, I,
It should not start with a number and T
Avoid spaces in object names FALSE, TRUE, Inf, NA, NaN, NULL, break, else, for,
function, if, in, next, repeat, and while
• R is case-sensitive
variety is different from Variety
Vector
• collection of numeric, character or logical
values (one-dimensional array)
• Online help
> help.start()
R Script
• text file containing a list of R commands
and usually given the extension .R
• can be saved for later use
• for documentation and traceability
• To create a script
Click File/New Script
• To open a script
Click File/Open Script
Thank you!