file_matches | R Documentation |
FileFormat
instance.
Will test for match to either header file or data fileValidates whether a file name conforms to the specified FileFormat and verifies the existence of both header and data files.
file_matches(x, file_name)
## S4 method for signature 'FileFormat,character'
file_matches(x, file_name)
x |
A FileFormat object specifying the format requirements |
file_name |
A character string specifying the file name to validate |
The function performs the following validation steps:
Checks if the file name matches either the header or data format
Verifies the existence of the corresponding paired file
Returns FALSE
if either check fails
File names are validated using case-sensitive extension matching.
TRUE for match, FALSE otherwise
A logical value: TRUE
if the file matches the format and both header
and data files exist, FALSE
otherwise
header_file_matches
, data_file_matches
for individual
file type checking
## Not run:
# Create a FileFormat for ANALYZE format
fmt <- new("FileFormat", header_extension = "hdr", data_extension = "img")
# Check if files exist and match format
file_matches(fmt, "brain_scan.hdr") # TRUE if both .hdr and .img exist
file_matches(fmt, "brain_scan.nii") # FALSE for wrong extension
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.