Re: [R] Checking existance of a directory

2010-10-29 Thread Prof Brian Ripley
On Fri, 29 Oct 2010, Ron Michael wrote: Hi all, I am wondering is there any way to check whether some Directory exists or not, given the parent path of that directory? After searching for a while I found that there is a function dir.create() to create some directory. However I need to know wh

Re: [R] Checking existance of a directory

2010-10-29 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 29/10/10 13:08, Ron Michael wrote: > Hi all, I am wondering is there any way to check whether some Directory > exists or not, given the parent path of that directory? After searching for a > while I found that there is a function dir.create() to c

Re: [R] Checking existance of a directory

2010-10-29 Thread Henrique Dallazuanna
Try this: if(!file.info('myfolder')$isdir) dir.create('myfolder') On Fri, Oct 29, 2010 at 9:08 AM, Ron Michael wrote: > Hi all, I am wondering is there any way to check whether some Directory > exists or not, given the parent path of that directory? After searching for > a while I found that th

Re: [R] Checking existance of a directory

2010-10-29 Thread Andris Jankevics
Hi, something like this perhaps, if("myfolder"%in%dir()==FALSE) dir.create("myfolder") Command dir.create() is not overwriting an existing folder. Best regards, Andris On Fri, Oct 29, 2010 at 12:08 PM, Ron Michael wrote: > Hi all, I am wondering is there any way to check whether some Director

[R] Checking existance of a directory

2010-10-29 Thread Ron Michael
Hi all, I am wondering is there any way to check whether some Directory exists or not, given the parent path of that directory? After searching for a while I found that there is a function dir.create() to create some directory. However I need to know whether such directory already exists or not,