new_unique {bayescount}R Documentation

CREATE A UNIQUE FILENAME

Description

Search the current working directory for a file or directory matching the input name, and if it exists create 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. Used by the bayescount function.

Usage

new_unique(name, suffix = "", ask = FALSE, prompt = "A file or directory with this name already exists.  Overwrite?  ")

Arguments

name the filename to be used (character string).
suffix the file extension (including '.') to use (character string). Default none.
ask if a file exists with the input name, should the function ask to overwrite the file? (logical) If FALSE, a new filename is used instead and no files will be over-written. Default FALSE.
prompt if ask==TRUE, what text string should be used to prompt the user? (charcter string) A generic default is supplied.

Author(s)

Matthew Denwood m.denwood.1@research.gla.ac.uk, funded as part of the DEFRA VTRI project 0101.

See Also

bayescount

Examples

#  Create a file name with a .R extension.
new_unique("new_file", ".R", ask=FALSE)

[Package bayescount version 0.5.1 Index]