change.extension: change the extension of a file

View source: R/flowchart.R

change.extensionR Documentation

change the extension of a file

Description

change the extension of a file

Usage

change.extension(file, ext.from, ext.to)

Arguments

file

a character giving the file path

ext.from

the extension to change from

ext.to

the extension to change to

Details

if the file has the extension given by ext.from, then the extension is changed. Otherwise, the extension given by ext.to is appended to file.

Examples

# both of the following gives "test.pdf"
change.extension("test.tex", ".tex", ".pdf")
change.extension("test", ".tex", ".pdf")

junlingm/REpiSim documentation built on Nov. 28, 2023, 2:35 a.m.