I suppose it's very simple but I can't find the way to generate a sequence of characters, e.g. from "a" to "z". Could you please help me with this? -- View this message in context: http://www.nabble.com/how-to-generate-sequence-%22a%22---%22z%22-tp15158509p15158509.html Sent from the R help mailing list archive at Nabble.com.
Even easier than you think... G.> letters[1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o" "p" "q" "r" "s" [20] "t" "u" "v" "w" "x" "y" "z" On Tue, Jan 29, 2008 at 04:39:11AM -0800, skestin wrote:> > I suppose it's very simple but I can't find the way to generate a sequence of > characters, e.g. from "a" to "z". > Could you please help me with this? > -- > View this message in context: http://www.nabble.com/how-to-generate-sequence-%22a%22---%22z%22-tp15158509p15158509.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.-- Csardi Gabor <csardi at rmki.kfki.hu> UNIL DGM
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 skestin schrieb: | I suppose it's very simple but I can't find the way to generate a sequence of | characters, e.g. from "a" to "z". | Could you please help me with this? ?letters letters HTH, B. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHnx9IUsbvfbd00+ERAuasAKCYIZ9KC4c3NoDFfkdDP0MyZckinwCbBQv7 CX249me9JFbVlWNPy/mDtV0=Vaea -----END PGP SIGNATURE-----
-- X-USF-Spam-Status: hits=-2.6 tests=BAYES_00 X-USF-Spam-Flag: NO Hello, Sequences of letters can be generated by typing LETTERS #for capital letters or letters #for small letters Best wishes Christoph skestin schrieb:> I suppose it's very simple but I can't find the way to generate a sequence of > characters, e.g. from "a" to "z". > Could you please help me with this?
On 1/29/2008 7:39 AM, skestin wrote:> I suppose it's very simple but I can't find the way to generate a sequence of > characters, e.g. from "a" to "z". > Could you please help me with this?If you want the standard collation sequence, use the letters variable, as others have said. If you want the sequence that applies in your locale (where does "?" fall?), it's harder. I don't know a simple way, but this gives you collation order in the German locale in Windows: > x <- as.raw(32:255) > y <- readChar(x, rep(1, 224)) > Sys.setlocale("LC_COLLATE", "German") [1] "German_Germany.1252" > sort(y) [1] "\177" "?" "?" "?" "?" "?" "'" "-" "?" "?" [11] "?" " " " " "!" "\"" "#" "$" "%" "&" "(" [21] ")" "*" "," "." "/" ":" ";" "?" "@" "[" [31] "\\" "]" "^" "?" "_" "`" "{" "|" "}" "~" [41] "?" "?" "?" "?" "?" "?" "?" "?" "?" "?" [51] "?" "?" "?" "?" "?" "?" "+" "<" "=" ">" [61] "?" "?" "?" "?" "?" "?" "?" "?" "?" "?" [71] "?" "?" "?" "?" "?" "?" "?" "?" "?" "?" [81] "?" "?" "?" "0" "?" "?" "?" "1" "?" "2" [91] "?" "3" "?" "4" "5" "6" "7" "8" "9" "a" [101] "A" "?" "?" "?" "?" "?" "?" "?" "?" "?" [111] "?" "?" "?" "?" "?" "?" "b" "B" "c" "C" [121] "?" "?" "d" "D" "?" "?" "e" "E" "?" "?" [131] "?" "?" "?" "?" "?" "?" "f" "F" "?" "g" [141] "G" "h" "H" "i" "I" "?" "?" "?" "?" "?" [151] "?" "?" "?" "j" "J" "k" "K" "l" "L" "m" [161] "M" "n" "N" "?" "?" "o" "O" "?" "?" "?" [171] "?" "?" "?" "?" "?" "?" "?" "?" "?" "?" [181] "?" "?" "p" "P" "q" "Q" "r" "R" "s" "S" [191] "?" "?" "?" "t" "T" "?" "?" "?" "u" "U" [201] "?" "?" "?" "?" "?" "?" "?" "?" "v" "V" [211] "w" "W" "x" "X" "y" "Y" "?" "?" "?" "?" [221] "z" "Z" "?" "?"
Apparently Analagous Threads
- How to group data by day
- Age of Conan, Wine 1.3.23, Mac OS 10.6.7 ?
- klibc-0.130: s390, run-init
- cvs commit: src/contrib/pf/pfctl parse.y src/lib/libc/sys Symbol.map getsockopt.2 src/sbin/ipfw ipfw.8 ipfw2.c src/sys/conf NOTES options src/sys/contrib/ipfilter/netinet ip_fil_freebsd.c src/sys/contrib/pf/net pf.c pf_ioctl.c src/sys/kern init_sysent.c
- Huge number