Does anybody knows how can i replace "\" in r?
Other answers have posted something like:
l <- "1120190\neconomic"
gsub("\\", "", l, fixed=TRUE)
But didn't work in my case.
Does anybody knows how can i replace "\" in r?
Other answers have posted something like:
l <- "1120190\neconomic"
gsub("\\", "", l, fixed=TRUE)
But didn't work in my case.
The \n
is a symbol for newline and if you want to replace it with space you can use the following:
l <- "1120190\neconomic"
cat(l)
gsub("\n", " ", l, fixed=TRUE)
Note, that the output would be:
1120190
economic
[1] "1120190 economic"