Search the current working directory for a file or directory matching the input name, and if it exists suggest a new name by appending a counter to the input name. Alternatively, the function can ask the user if the existing file should be overwritten, in which case the existing file will be erased if the answer is 'yes'. The function also checks for write access permissions at the current working directory. Used by the bayescount function.
Usage
new_unique(name, suffix = "", ask = FALSE, prompt = "A file or directory with this name already exists. Overwrite?")
Arguments
Value
A unique filename that is safe to use without fear of destroying existing files