Learn R Programming

Renext (version 2.0-0)

readXML: Read data using an XML index file

Description

Read one or several dataset(s) using an XML index file specifying the data sets to read and the structure of each

Usage

readXML(name,
           dir,
           index = "index.xml",
           trace = 0)

Arguments

name
Name for the dataset that will be matched against the name attribute of datasets as they are given in the index file.
dir
Path to the directory where the index file and all data files should be found.
index
Name (short) of the index file. This file must be in the directory given by dir.
trace
Integer or logical to trace the successive steps by short indications.

Value

  • A list with the data read.
  • infoGeneral information about the data: varName, varShorlLab and varUnit give the variable name unit and short label.
  • OTinfoInformation for the Over the Threshold (OT).
  • OTdataOver the Threshold (OT) data.
  • OTmissingMissing periods within the OTdata period.
  • MAXinfoInformation for the MAX ($r$-largest) supplement data.
  • MAXdataMAX supplement data.
  • OTSinfoInformation for the Over the Threshold Supplement (OTS) data.
  • OTSdataOver the Threshold (OT) supplement data.

Details

The XML index file is parsed within R. Then according to the indications within the index file, other files are read (e.g. csv files). In this way, data returned as a list can contain heterogeneous data: Over Threshold (OT) data, missing periods, MAX data, etc. Various pieces of information are also stored in list elements with name containing the "info" string.

This function requires the CRAN package XML.

See Also

See Brest for an example of such a list. See URL https://gforge.irsn.fr/gf/project/renext for data related to Renext.

Examples

Run this code
library(XML)
## use 'index.xml' file shiped with Renext
dir1 <- system.file("Rendata", package = "Renext")
BrestNew1 <- readXML(name = "Brest", dir = dir1)
test1 <- readXML(name = "test1", dir = dir1)

Run the code above in your browser using DataLab