Search code examples
rpasteslash

R: how to paste0() backslash?


I need to output windows directory, however for paste0() I can only use "\", for example paste0("C:\\AB\\", "CD") where the output is "C:\\AB\\CD".

How to convert this to "C:\AB\CD"?


Solution

  • The answer is using cat()

    cat("C:\\AB\\CD")
    > C:\AB\CD