Re: [R] Difficulty with "\\" in string functions....

2019-02-11 Thread Bernard
Simple when you know how! Thanks Sent from mobile device - please excuse any spelling mistakes. -- Original Message -- From: William Dunlap To: Bernard McGarvey Cc: Ivan Krylov, r-help@r-project.org Sent: February 11, 2019 at 4:29 PM Subject: Re: [R] Difficulty with "\\"

Re: [R] Difficulty with "\\" in string functions....

2019-02-11 Thread William Dunlap via R-help
You can also avoid the issue by using the basename and dirname functions. > Fname1 <- "D:\\Data\\OneDrive\\ISTA Documents\\QT_App\\QT Analysis Input Data Example WorkBook.xlsx" > basename(Fname1) [1] "QT Analysis Input Data Example WorkBook.xlsx" > dirname(Fname1) [1] "D:/Data/OneDrive/ISTA

Re: [R] Difficulty with "\\" in string functions....

2019-02-11 Thread Bernard McGarvey
Brilliant! Thanks a million Ivan. Lion Bernard McGarvey Director, Fort Myers Beach Lions Foundation, Inc. Retired (Lilly Engineering Fellow). > On February 11, 2019 at 3:13 PM Ivan Krylov wrote: > > > On Mon, 11 Feb 2019 15:01:16 -0500 (EST) > Bernard McGarvey wrote: > > > Now I try to

Re: [R] Difficulty with "\\" in string functions....

2019-02-11 Thread Ivan Krylov
On Mon, 11 Feb 2019 15:01:16 -0500 (EST) Bernard McGarvey wrote: > Now I try to split it using > > > str_split(Fname1,"\\") > > > but this returns an error > > > Error in stri_split_regex(string, pattern, n = n, simplify = > simplify, : Unrecognized backslash escape sequence in pattern. >

[R] Difficulty with "\\" in string functions....

2019-02-11 Thread Bernard McGarvey
I am using the file.choose() function to choose a file from the dialog box and once I get it, I want to be able to split the full name into the folder part and the file name part. So for example, when I have closed the file choose dialog, the name for the file I get is Fname1 [1]