In R, while parsing a windows directory address or in general parsing a text string with backstrokes throws the following error:
> 'C:\Users'
Error: '\U' used without hex digits in character string starting "'C:\U"
How to parse such strings?
In R, while parsing a windows directory address or in general parsing a text string with backstrokes throws the following error:
> 'C:\Users'
Error: '\U' used without hex digits in character string starting "'C:\U"
How to parse such strings?
With R>4.0.0, it is possible to parse such strings with following syntax:
> r"(C:\Users)"
[1] "C:\\Users"
Note that, ()
are part of syntax. For simplicity, one can also use r"{...}"
and r"[...]"