Check out file.exists() function!!
The function file.exists() returns a logical vector indicating whether the files named by its argument exist.
Note: Make sure that to provide file path for those, not in the current working directory.
> file.exists("leaflet.R")
[1] TRUE
Transform data into actionable insights with our Data Analytics Course – Enroll today!