[R] Summary --- testing for existence of file.

Rolf Turner rolf at maths.uwa.edu.au
Fri Nov 2 11:27:31 CET 2001

Many thanks to those who answered my question about how to test
for the existence of a file:  Berwin Turlach, Jari Oksanen, Henrik
Bengtsson, Uwe Ligges, and Joerg Maeder.

The simplest solution is to use the built-in (!!!) function
file.exists() which returns TRUE if the file exists, and FALSE
if it doesn't.  Like, duhhhhhh!!!  It's exactly what I wanted.

Special thanks to Berwin Turlach who explained to me how I might
have found out about file.exists() for my own self ---

> 1.) In R type help.start().
> 2.) Go to browser and select "Search Engine & Keywords".
> 3.) Enter "file" as search keyword and press the search button
> 4.) Peruse the list of hits until something suitable comes up

A couple of suggestions to the developers:

	1) It would nice for us bunnies if, say, help.search() made
	a suggestion to do Berwin's four steps if help.search()
	itself turns up nothing useful.

	2) The ``See also'' for file.access et al. should include
	``files'' which contains the documentation on a whole
	elephantful of useful functions.  The item ``files'' comes
	last in the items of the list turned up by the search wherein
	the word ``file'' actually appears in the link.  The faint
	of heart might well become discouraged before getting there.
        I also think that an explicit link from file.access to
	file.exists (the two are closely related) would be helpful.

Thanks again to all my enlighteners.


						Rolf Turner
						rolf at math.unb.ca
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list