R
has a number of build in constants. The following constants are available:
LETTERS
: the 26 upper-case letters of the Roman alphabetletters
: the 26 lower-case letters of the Roman alphabetmonth.abb
: the three-letter abbreviations for the English month
namesmonth.name
: the English names for the months of the yearpi
: the ratio of the circumference of a circle to its diameterFrom the letters and month constants, vectors can be created.
1) Sequences of letters:
> letters
[1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o" "p" "q" "r" "s" "t" "u" "v" "w" "x" "y" "z"
> LETTERS[7:9]
[1] "G" "H" "I"
> letters[c(1,5,3,2,4)]
[1] "a" "e" "c" "b" "d"
2) Sequences of month abbreviations or month names:
> month.abb
[1] "Jan" "Feb" "Mar" "Apr" "May" "Jun" "Jul" "Aug" "Sep" "Oct" "Nov" "Dec"
> month.name[1:4]
[1] "January" "February" "March" "April"
> month.abb[c(3,6,9,12)]
[1] "Mar" "Jun" "Sep" "Dec"