powered by
This helper function takes a file name fileName, removes an extension (a suffix) from it and adds a new extension newSuffix.
fileName
newSuffix
replaceSuffix(fileName, newSuffix)
A character vector with original filenames
A new extension to replace old extensions in file names fileName
A character vector with new file names with old extensions replaced with newSuffix
# NOT RUN { replaceSuffix('filename.Rmd', '.pdf') # 'filename.pdf' replaceSuffix(c('a.x', 'b.y', 'c.z'), '.csv') # 'a.csv', 'b.csv', 'c.csv' # }
Run the code above in your browser using DataLab