Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201839

How to create xml from R objects, e.g., is there a 'listToXml' function?

$
0
0

R's XML package has an xmlToList function, but does not have the reverse, is there a function for R that will convert a list to an XML object?

I would like something like

listToXML(list('a'))

that returns

<a></a>

but the closest I can find is

library(XML)
xmlNode(list('a'))

which returns

</a>

help on this question, and understanding the conversion of R objects to XML in general appreciated (the XML package appears more focused on the use of R to read XML, with less support for creating XML).

Update... One reason that I could not figure this out is because I did not realize that the trailing '/' in <node/> indicates an empty node, equivalent to <node></node>


Viewing all articles
Browse latest Browse all 201839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>