[R] \ escape sequence and windows path

Gabor Grothendieck ggrothendieck at gmail.com
Wed May 21 15:49:46 CEST 2014


On Wed, May 21, 2014 at 9:25 AM, Jeff Newmiller
<jdnewmil at dcn.davis.ca.us> wrote:
> I tend to view this as enforced training in string escaping.
>
> One option i have not seen mentioned is the file.choose function, which is GUI but a little tedious for deep directories.

I also was thinking about that too but note that file.choose() does
not work for directories so you need a second command choose.dir() for
those.   readline(), which the poster mentioned, does work for both
cases.

If the context of this is writing an R script and you want to paste it
into your editor session then any powerful editor has the capability
of adding functions to perform such transformations. e.g.
http://vim.wikia.com/wiki/Copy_filename_to_clipboard

Many other programming languages that support escape sequences in
string literals also have a syntax to not interpret the escapes and R
really needs that capability too.  For example,
https://docs.python.org/2.0/ref/strings.html

Other usage scenarios where this would be useful are dealing with
literal latex text and dealing with text literals containing both
single and double quotes.



More information about the R-help mailing list