Skip to contents

Replace file extension

Usage

replace_file_ext(fp, ext = "")

Arguments

fp

Character vector of file paths.

ext

String. Extension (with dot) to change to.

Examples

replace_file_ext("x/y/zcda.txt")
#> [1] "x/y/zcda"
replace_file_ext(paste0(1:3, ".txt"), ".stan")
#> [1] "1.stan" "2.stan" "3.stan"