Skip to contents

Replace the file name extension in a file name or file path

Usage

replaceFileExtension(file, extension)

Arguments

file

file name or full path to a file

extension

new file name extension (including the dot, e.g. ".txt")

Examples

replaceFileExtension(file = "run.bat", ".txt")
#> [1] "run.txt"