Skip to content
Prev 86865 / 398502 Next

Reanding a windows file

"Alexandra R. M. de Almeida" <alexandrarma at yahoo.com.br> writes:
"D:\CSV\Work\test.csv" without change the "\" by "/" by myself?!
Well, there's no problem with the backslashed form except if you try
copying it literally into R source code. If you do, you run into
problems with R interpreting the backslash as an escape character,
which itself needs to be escaped ("doubling the backslashes"). You
might for instance proceed as follows:
D:\CSV\Work\test.csv
[1] "D:\\CSV\\Work\\test.csv"
Notice that x as such has only single backslashes, it is just the
print routine that inserts escape characters:
D:\CSV\Work\test.csv
[1] 20

123456789*123456789*