tags:

views:

111

answers:

2

In R, how can I print a character list from A to Z? With integers I can say:

my_list = c(1:10)
> my_list
 [1]  1  2  3  4  5  6  7  8  9 10

But can I do the same with characters? e.g.

my_char_list = c(A:Z)
my_char_list = c("A":"Z")

These don't work, I want the output to be: "A" "B" "C" "D", or separated by commas.

Thanks.

+10  A: 
LETTERS

"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"
gd047
+4  A: 
> 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"
[25] "Y" "Z"
> 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"
[25] "y" "z"
> LETTERS[5:10]
[1] "E" "F" "G" "H" "I" "J"
> 
William Doane