Description Usage Arguments Value Note Author(s) See Also Examples
Convert character vector to ASCII, replacing non-ASCII characters with single-byte (\x00) or two-byte (\u0000) codes.
1 | ASCIIfy(x, bytes = 2, fallback = "?")
|
x |
a character vector, possibly containing non-ASCII characters. |
bytes |
either |
fallback |
an output character to use, when input characters cannot be converted. |
A character vector like x
, except non-ASCII characters have
been replaced with \x00 or \u0000 codes.
To render single backslashes, use these or similar techniques:
1 2 |
The resulting strings are plain ASCII and can be used in R functions and datasets to improve package portability.
Arni Magnusson arnima@hafro.is
showNonASCII
identifies non-ASCII characters in
a character vector.
1 2 3 4 5 6 7 8 |
[1] "S<U+00E3>o Paulo" "Reykjav<U+00ED>k"
[1] "S\\xe3o Paulo" "Reykjav\\xedk"
[1] "S\\u00e3o Paulo" "Reykjav\\u00edk"
[1] "<U+0391><U+03B8><U+03AE><U+03BD><U+03B1>"
[1] "\\u0391\\u03b8\\u03ae\\u03bd\\u03b1"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.