Re: [R] Formatting a path for unix with gsub

2012-12-17 Thread William Dunlap
wdunlap tibco.com > -----Original Message----- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf > Of Nathan Skene > Sent: Monday, December 17, 2012 9:45 AM > To: r-help@r-project.org > Subject: [R] Formatting a path for unix with gsub >

Re: [R] Formatting a path for unix with gsub

2012-12-17 Thread David Winsemius
On Dec 17, 2012, at 9:44 AM, Nathan Skene wrote: > I have a path: > > path = "/nfs/users/nfs_n/ns9/ > Phenotype Analysis/Results/Run_AmplRatio_neg > BinaryAll trained without akapn+tnik.csv" > > I wish to replace the spaces with "\ " so that it can be read by a system > call to unix. > > Using

[R] Formatting a path for unix with gsub

2012-12-17 Thread Nathan Skene
I have a path: path = "/nfs/users/nfs_n/ns9/ Phenotype Analysis/Results/Run_AmplRatio_neg BinaryAll trained without akapn+tnik.csv" I wish to replace the spaces with "\ " so that it can be read by a system call to unix. Using gsub I try: > gsub(" ","\\ ",path) [1] "/nfs/users/nfs_n/ns9/Phenotyp