Write biotic data as XML file(s).
BioticData
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)
BioticData
may contain several data sets.
In that case the parameters 'FileNames' and 'namespaces' must be provided for each
in the order they appear in 'BioticData'.
Supports writing to namespaces: http://www.imr.no/formats/nmdbiotic/v1.1 http://www.imr.no/formats/nmdbiotic/v1.2 http://www.imr.no/formats/nmdbiotic/v1.3 http://www.imr.no/formats/nmdbiotic/v3 http://www.imr.no/formats/nmdbiotic/v3.1
exampleFile <- system.file("testresources","biotic3.1_example.xml", package="RstoxData")
bioticData <- ReadBiotic(exampleFile)
newFile <- tempfile(fileext = ".xml")
WriteBiotic(bioticData, newFile, namespaces = "http://www.imr.no/formats/nmdbiotic/v3.1")
bioticDataReadBackIn <- ReadBiotic(newFile)
all.equal(
bioticData[[1]][names(bioticData[[1]]) != "metadata"],
bioticDataReadBackIn[[1]][names(bioticDataReadBackIn[[1]]) != "metadata"]
)
#> [1] TRUE