R/splitMultiblockDX.R
splitMultiblockDX.Rd
Process a multiblock JCAMP-DX file into separate files, one for each data set.
splitMultiblockDX(file = NULL, subdir = "data_sets")
Length one character giving the name of the multiblock file.
Character. If not NULL
, a subdirectory by this name will be
created in the working directory, and the individual files will be placed
in this subdirectory. If the subdirectory already exists, an error will be thrown.
A list is returned invisibly that has one DX data set per list element. Individual files
are written into the current directory if subdir = NULL
, so you probably want
to work on a copy of the data
in this case. File names are extracted from the
##TITLE= sample_name
field and will be sample_name
(more precisely,
the name will be whatever follows ##TITLE=
on the line). If
sample names are duplicated the output files will be overwritten as the file
is processed (with a warning). In this case you should open the multiblock file in a plain text
editor and search for ##TITLE=
, then edit the names to be unique before
running this function. Also, you should ensure that sample_name
will
result in a valid file name on your operating system.
Individual data sets are written into the current directory if you set subdir
to NULL
, so you may want to work on a copy of the data in this case.