Check the filename passed as an argument to be valid
chkfilename(filename, expand = FALSE)a charachter string showing an optional directory and a required filename.
A Boolean varable. If assigns as TRUE, it will expand a path name, for example by replacing a leading tilde by the user's home directory (if defined on that platform)
The output is a charachter string to save an output.
reqpar function gets a character string. Trim the string and make sure its not empty. In case the user has provided a full path, the path is checked to be existant.