What is wrong with winpath <- readLines("clipboard ")
? If you want to show that as a literal in your code, then don't bother assigning it to a variable, but let it echo to output and copy THAT and put it in your source code. There is also file.choose()... --------------------------------------------------------------------------- Jeff Newmiller The ..... ..... Go Live... DCN:<jdnew...@dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --------------------------------------------------------------------------- Sent from my phone. Please excuse my brevity. On April 8, 2014 8:00:03 AM PDT, Jonathan Greenberg <j...@illinois.edu> wrote: >R-helpers: > >One of the minor irritations I have is copying paths from Windows >explorer, which look like: > >C:\Program Files\R\R-3.0.3 > >and using them in a setwd() statement, since the "\" is, of course, >interpreted as an escape character. I have to, at present, manually >add in the double slashes or reverse them. > >So, I'd like to write a quick function that takes this path: > >winpath <- "C:\Program Files\R\R-3.0.3" > >and converts it to a ready-to-go R path -- is there a way to have R >IGNORE escape characters in a character vector? > >Alternatively, is there some trick to using a copy/paste from Windows >explorer I'm not aware of? > >--j ______________________________________________ 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.