A way of checking if a string is a valid file name.
A copy from R's grDevices:::checkIntFormat because it is not exported there
checkIntFormat(s)
s
logical: TRUE or FALSE
R Core Development Team
Useful links