アスキーの印刷可能な文字は、32〜126で表されます。そのベクトルを生成し、「生」に変換して関数を使用して実際の文字に変更することができます。その後、文字列を分割します。
> strsplit(rawToChar(as.raw(32:126)), "")[[1]]
[1] " " "!" "\"" "#" "$" "%" "&" "'" "(" ")" "*" "+" "," "-" "."
[16] "/" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" ":" ";" "<" "="
[31] ">" "?" "@" "A" "B" "C" "D" "E" "F" "G" "H" "I" "J" "K" "L"
[46] "M" "N" "O" "P" "Q" "R" "S" "T" "U" "V" "W" "X" "Y" "Z" "["
[61] "\\" "]" "^" "_" "`" "a" "b" "c" "d" "e" "f" "g" "h" "i" "j"
[76] "k" "l" "m" "n" "o" "p" "q" "r" "s" "t" "u" "v" "w" "x" "y"
[91] "z" "{" "|" "}" "~"
を与える
strsplit(rawToChar(as.raw(32:126)), "")[[1]]