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 <ron_michae...@yahoo.com> 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 whether such directory already exists or not, 
> otherwise I will create that.
>
> Thanks,
>
>
>        [[alternative HTML version deleted]]
>
>
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to