Re: [R] How to convert "c:\a\b" to "c:/a/b"?

From: Mulholland, Tom <>
Date: Tue 28 Jun 2005 - 14:24:35 EST

> -----Original Message-----
> From:
> []On Behalf Of Henrik Bengtsson
> Sent: Tuesday, 28 June 2005 2:54 AM
> To: Spencer Graves
> Cc:; Dirk Eddelbuettel
> Subject: Re: [R] How to convert "c:\a\b" to "c:/a/b"?
... snipped  

> Thus, you cannot write your program such that it fools the parser,
> because your program is evaluated first after the parser. In other
> words, there is no way you can get nchar("\n") to equal 2.

I had been waiting for this answer because it was the conclusion I had come to. Given that I mainly work in a windows world this has been a problem. For various reasons I receive files liberally sprinkled with such pathnames. I generally pre-process them using whatever is at hand. It's not a big problem, just annoying to have to explain to collegues that this is something R can't do. Not a good advertisment for those who have no idea about escape codes.

However I can't believe that this problem cannot be solved. The thoughts that have come through my head are to write a c routine that effectively ignores the possibility that \n means newline and thus remaps all the escape codes into text (\\ and the character code.)

I've never written in C which is one of the reasons that I have never attempted this. I would be interested in any thoughts about the viability of my proposal. It seems an awful lot of work (at least for someone who hasn't done this sort of stuff before) for something that can be achieved in many other ways.

Tom mailing list PLEASE do read the posting guide! Received on Tue Jun 28 14:31:55 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:33:03 EST