When the path is not given, the function forget the final "/" so the generated path does not work.
A possible fix should be to change: paste(path, filename, sep = "") by paste(path, filename, sep = "/")
But since user may give path with final "/" or not and even use "\" we should be this function much more robust!
When the path is not given, the function forget the final "/" so the generated path does not work. A possible fix should be to change: paste(path, filename, sep = "") by paste(path, filename, sep = "/") But since user may give path with final "/" or not and even use "\" we should be this function much more robust!