Complete the extension of a file (.r or .R).
complete_extension(name, base = NULL)
name | character. The filename sans extension. |
---|---|
base | character. A base path to be prefixed to |
name
suffixed by ".r" or ".R" according to which exists.
(Many Unix-based systems are extension case-sensitive).
This function assumes at least one file ending in .r or .R exists.
not_run({ # Assume we have a file \code{"foo.R"}. stopifnot(complete_extension("foo") == "foo.R") # Assume we have a file \code{"bar.r"}. stopifnot(complete_extension("bar") == "bar.R") })