xmlReadData_data.frame: Read XML Data From Type 'xmlReadData_data.frame' as R...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/utils.xmlRead.R

Description

Read XML Data From Type 'xmlReadData_data.frame' as R 'data.frame'

Usage

1
xmlReadData_data.frame(xmlItem, na_to_none = FALSE)

Arguments

xmlItem

(XMLNode) Object of class XMLNode that defines the a data frame and fullfills XSD definition 'xmlReadData_data.frame'.

na_to_none

(logical) Convert NAs to empty characters (i.e. ”).

Value

(data.frame)

Author(s)

Matthias Pfeifer matthias.pfeifer@roche.com

See Also

XMLNode-class

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data <- '<data.frame><col-defs>
<coldef name="Column1" type="character"/>
<coldef name="Column2" type="numeric"/>
</col-defs>
<row name="1"><cell>ID1</cell><cell>1</cell></row>
<row name="2"><cell>ID2</cell><cell>2.1</cell></row>
<row name="3"><cell>ID3</cell><cell>3.1</cell></row>
</data.frame>'
item <- XML::xmlRoot(XML::xmlParse(data,asText=TRUE))
value <- RTest::xmlReadData_data.frame(item)
stopifnot(dim(value)[1]==3)
stopifnot(dim(value)[2]==2)

RTest documentation built on Dec. 4, 2019, 5:07 p.m.