# Create a very simple representation of a simple dataset.
# This is just an example. The result is
#
#
#
# A
#
#
# B
#
#
#
# 1.2 3.5
#
#
# 20.2 13.9
#
#
# 10.1 5.67
#
#
n = xmlNode("data", attrs = c("numVars" = 2, numRecords = 3))
n = append.xmlNode(n, xmlNode("varNames", xmlNode("string", "A"), xmlNode("string", "B")))
n = append.xmlNode(n, xmlNode("record", "1.2 3.5"))
n = append.xmlNode(n, xmlNode("record", "20.2 13.9"))
n = append.xmlNode(n, xmlNode("record", "10.1 5.67"))
print(n)
if (FALSE) {
tmp <- lapply(references, function(i) {
if(!inherits(i, "XMLNode"))
i <- xmlNode("reference", i)
i
})
r <- xmlNode("references")
r[["references"]] <- append.xmlNode(r[["references"]], tmp)
}
Run the code above in your browser using DataLab