Write acoustic data as XML file(s).
AcousticData
data to write.
paths to files that should be written to
XML namespaces to use for formatting.
encoding to use for writing files
whether to overwrite any existing file(s)
AcousticData
may contain several data sets.
In that case the parameters 'FileNames' and 'namespaces' must be provided for each
in the order they appear in 'AcousticData'.
Supports writing to namespaces: http://www.imr.no/formats/nmdechosounder/v1
exampleFile <- system.file(
"testresources","libas_ListUserFile20__L40.0-2259.9_small.xml", package="RstoxData")
acousticData <- ReadAcoustic(exampleFile)
newFile <- tempfile(fileext = ".xml")
WriteAcoustic(acousticData, newFile, namespaces = "http://www.imr.no/formats/nmdechosounder/v1")
acousticDataReadBackIn <- ReadAcoustic(newFile)
all.equal(
acousticData[[1]][names(acousticData[[1]]) != "metadata"],
acousticDataReadBackIn[[1]][names(acousticDataReadBackIn[[1]]) != "metadata"]
)
#> [1] "Component “sa”: Column 'ch': Mean relative difference: 0.2962963"
#> [2] "Component “acocat”: Column 'acocat': Mean relative difference: 0.7692308"