1

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?

Henrik
  • 61,039
  • 13
  • 131
  • 152
monte
  • 1,145
  • 5
  • 18

1 Answers1

2

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"[...]"

monte
  • 1,145
  • 5
  • 18