On Tue, 2 Sep 2008, Leon Yee wrote:

Dear all,

I have a string (a file path in windows system) contains several "\"s. When I copy and paste it into R for assignment to an variable, the "\"s are always interpreted as escaping characters. How can I keep it intact?

By reading from a file or connection, as in

foo <- scan("", "", n=1)
c:\tmp\foo

The parser always interprets \ in strings, so you must avoid the parser.

--
Brian D. Ripley,                  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to