Hei, is it possible to create from R a series of files with unique(random) names? I have tryed with file.create and dir.create but did not manage to do it. Thanks a lot for help Sara [[alternative HTML version deleted]]
How about this? name.length = 10 name = paste(sample(letters,name.length,T),collapse="") Then you can use file.exists(), to check if the file already exists. On Mon, Aug 11, 2008 at 12:28 PM, sara martino <martino@math.ntnu.no> wrote:> Hei, > is it possible to create from R a series of files with unique(random) > names? > I have tryed with file.create and dir.create but did not manage to do it. > Thanks a lot for help > Sara > > [[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. >[[alternative HTML version deleted]]
See ?tempfile On Mon, 11 Aug 2008, sara martino wrote:> Hei, > is it possible to create from R a series of files with unique(random) names? > I have tryed with file.create and dir.create but did not manage to do it. > Thanks a lot for help > Sara > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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. >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595