header_file | R Documentation |
FileFormat
instance.Derives the header file name from a given file name based on the FileFormat specifications.
header_file(x, file_name)
## S4 method for signature 'FileFormat,character'
header_file(x, file_name)
x |
A FileFormat object specifying the format requirements |
file_name |
A character string specifying the file name to derive the header file name from |
The function performs the following steps:
If the input file_name already matches the header file format, it returns the file_name as is.
If the file_name matches the data file format, it constructs and returns the corresponding header file name.
If the file_name doesn't match either format, it throws an error.
the correct header name
A character string representing the header file name
data_file
, strip_extension
for related file name
manipulation
## Not run:
fmt <- new("FileFormat", header_extension = "hdr", data_extension = "img")
header_file(fmt, "brain_scan.hdr") # Returns "brain_scan.hdr"
header_file(fmt, "brain_scan.img") # Returns "brain_scan.hdr"
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.