Skip to contents

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.

Usage

readmulti_SIVIM_xml(files, parallelize = TRUE, n.cores = 8, n.chunks = 16)

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 If TRUE (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.