Re: [R] extract file name from a path string

2015-02-26 Thread John McKown
Look at "dirname()" and "basename()". The first would be what you call the path. The second is the file.name without the path. On Thu, Feb 26, 2015 at 10:58 AM, Luigi Marongiu wrote: > Dear all, > what code should I write in order to extract the file name from a give > path? Let's say that I want

[R] extract file name from a path string

2015-02-26 Thread Luigi Marongiu
Dear all, what code should I write in order to extract the file name from a give path? Let's say that I want to get the file "my file.xls" which is in the directory/folder "My documents"; since I work both with Windows and Linux, the paths I am looking at are in the format: path.windows<-"\\home$\