Generic function to strip extension from file name, given a FileFormat instance.
Source: R/all_generic.R, R/file_format.R
strip_extension-methods.RdRemoves the file extension from a given file name based on the FileFormat specifications.
Usage
strip_extension(x, file_name)
# S4 method for class 'FileFormat,character'
strip_extension(x, file_name)Arguments
- x
A FileFormat object specifying the format requirements
- file_name
A character string specifying the file name to strip the extension from
Value
A character string file_name without its extension.
A character string representing the file name without the extension
Details
The function performs the following steps:
If the file_name matches the header file format, it removes the header extension.
If the file_name matches the data file format, it removes the data extension.
If the file_name doesn't match either format, it throws an error.
See also
header_file, data_file for related file name
manipulation