Checking Files from the Command Line

It can be useful to check whether a given filename exists in the path where you think it should be. The function is file.exists and is used like this:

file.exists("c:\\temp\\Decay.txt")

[1] TRUE

For more on file handling, see ?files.

Get The R Book now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.