"Alexandra R. M. de Almeida" <[EMAIL PROTECTED]> writes:

> Dear R users
>  
>  Some one knows how to read a windows file with the adress like 
"D:\CSV\Work\test.csv" without change the "\" by "/" by myself?!
>  There is some function or parameter that read like the adress windows form.
>  I tried to search somethig to substitute the "\" by "/", but I don't find...

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:

> x <- readLines(,1) # input data on next line
D:\CSV\Work\test.csv
> x
[1] "D:\\CSV\\Work\\test.csv"
> mydata <- read.csv(x)

Notice that x as such has only single backslashes, it is just the
print routine that inserts escape characters:

> cat(x,"\n")
D:\CSV\Work\test.csv
> nchar(x)
[1] 20

123456789*123456789*




-- 
   O__  ---- Peter Dalgaard             Ă˜ster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - ([EMAIL PROTECTED])                  FAX: (+45) 35327907

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to