Re: [R] Returning only a file path on Windows

2009-05-22 Thread Uwe Ligges
Are you looking for choose.dir() ? Or basename() and dirname()? Uwe Ligges am...@xs4all.nl wrote: I am choosing a file like this: #Bring up file selection box fn<-file.choose() fp<-file.path(fn,fsep='\\') Unfortunately, the file path contains the short file name and extension as well. I had h

Re: [R] Returning only a file path on Windows

2009-05-22 Thread Duncan Murdoch
On 5/22/2009 10:45 AM, am...@xs4all.nl wrote: I am choosing a file like this: #Bring up file selection box fn<-file.choose() fp<-file.path(fn,fsep='\\') file.path() constructs a path from component parts, it doesn't extract the path from a filename. You want dirname(fn). You may also want