I have an issue creating a string with a special character. I have asked a similar question and I have also read answers to similar questions about my problem but I am not able to find the solution.
I want to create a string
character with a special character. I have been trying with cat
but I know it is only for printing, not for saving the string in a variable in R.
I want as a result this:
> cat("C:\\Users\\ppp\\ddd\\")
C:\Users\ppp\ddd\
and I have been trying with paste
and collapse
but without success:
> x = c("C:","Users","ppp","ddd")
> t <- paste0(x, collapse = '\n')
> t
[1] "C:\nUsers\nppp\nddd"