| seasonder_createSeaSondeRCS.character | R Documentation |
This method creates a SeaSondeRCS object by reading a file from the specified file path.
It verifies the file's existence, determines the file type ("CS", "CSSY" or "CSSW") using
seasonder_find_spectra_file_type, and then reads the file using the appropriate function.
If specs_path is not provided (or is set to rlang::zap()), the default YAML specifications
file path is retrieved using seasonder_defaultSpecsFilePath based on the detected file type.
## S3 method for class 'character'
seasonder_createSeaSondeRCS(x, specs_path = rlang::zap(), endian = "big", ...)
x |
A character string specifying the path to the SeaSonde CS file. |
specs_path |
A character string specifying the path to the YAML specifications for the CS file.
If not provided or set to |
endian |
A character string indicating the byte order. Options are "big" (default) or "little". |
... |
Additional parameters passed to |
The function performs the following steps:
Checks if the file specified by x exists; if not, it aborts with an error.
Determines the file type using seasonder_find_spectra_file_type.
If specs_path is not provided or is set to rlang::zap(), retrieves the default YAML
specifications path using seasonder_defaultSpecsFilePath based on the detected file type.
Reads the file using the appropriate function:
seasonder_readSeaSondeCSFile for CS files.
seasonder_readSeaSondeRCSSYFile for CSSY files.
seasonder_readSeaSondeRCSSWFile for CSSW files.
Creates a SeaSondeRCS object using new_SeaSondeRCS with the header and data obtained from the file.
Appends a processing step indicating the creation source via seasonder_setSeaSondeRCS_ProcessingSteps
with a creation step text generated by SeaSondeRCS_creation_step_text(x).
A SeaSondeRCS object.
new_SeaSondeRCS,
seasonder_find_spectra_file_type,
seasonder_defaultSpecsFilePath,
seasonder_readSeaSondeCSFile,
seasonder_readSeaSondeRCSSYFile,
seasonder_readSeaSondeRCSSWFile,
seasonder_setSeaSondeRCS_ProcessingSteps,
SeaSondeRCS_creation_step_text
# Create a SeaSondeRCS object from a file using the default YAML specifications
rcs_object <- seasonder_createSeaSondeRCS(
system.file("css_data/CSS_TORA_24_04_04_0700.cs", package = "SeaSondeR")
)
# Create a SeaSondeRCS object from a file with a specified YAML specifications file
rcs_object <- seasonder_createSeaSondeRCS(
system.file("css_data/CSS_TORA_24_04_04_0700.cs", package = "SeaSondeR"),
specs_path = seasonder_defaultSpecsFilePath("CS")
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.