Reads multiple XML files, as produced by SIVIM (version 1.2), importing to R data.frame
's the most relevant data (relevé table and the respective header), using package xml2
, optionally parallelizing the process using package parallel
.
Arguments
- files
character
A vector containing the names or paths to the XML files to import or a data.frame with two columns, the first with the names or paths to the XML files and the second with strings corresponding to expressions (to be parsed and evaluated) giving the column indices of the original table order, i.e. of the relevés to extract; for the cases where not the entire column is of interest). If only the names are given, the working directory must point to the files location.- parallelize
logical
IfTRUE
(the default) parallelizes the importing process;FALSE
for a non-parallelized version.- n.cores
numeric
The number of cores to use in parallelization.- n.chunks
numeric
The number of chunks to divide work. Can be deprecated in future.
Value
The function returns a list
with the following two components:
- table
a
data.frame
with the relevé tables (without the header)- header
a
data.frame
with the respective header data
Details
This function uses read_SIVIM_xml
to import the data inside the XML files, as exported from SIVIM, merging the data.
Author
Tiago Monteiro-Henriques. E-mail: tmh.dev@icloud.com.