Skip to content
Prev 26529 / 398502 Next

pasting "\" into character strings

On Sun, 22 Dec 2002 ripley at stats.ox.ac.uk wrote:

            
Reply: The problem with this command is that it produces

paste("c:",  "work", "part1.txt", sep="\\")
[1] "c:\\work\\part1.txt"

whereas I want "c:\work\part1.txt".  Some people have suggested to try
'file.path', but it either doesn't work, or I don't know how to make it
work.
Error: syntax error
[1] "c:\\work\\part1.txt"

John Miyamoto