[R] exportation of xml file from R

Duncan Temple Lang duncan at wald.ucdavis.edu
Thu Jun 25 17:06:15 CEST 2009


Hi Guillaume


Once you have created an XML representation using any of the various 
ways to represent XML in R via the XML package (e.g. internal nodes, 
lists of lists, hash trees), you can use the saveXML() function:

   saveXML(myXML, "fileName.xml")

Personally, I use newXMLNode() and friends and build the tree with
internal nodes.

  D.



guillaume Le Ray wrote:
> Hello everybody,
> 
> I have programed a function to translate the R object structure into a XML
> data structure but I haven't found a function in the XML package to export
> this data in an XML file!
> 
> my data look like that:
>     <Factor>Assessor:codec</Factor>
>     <Sum Sq> 33.98159</Sum Sq>
>     <Df>  28</Df>
>     <F value>  6.510894</F value>
>     <Pr(>F)> 1.725149e-22</Pr(>F)>
>    </line>
>    <line>
>     6
>     <Factor>Assessor:Sample</Factor>
>     <Sum Sq> 33.82264</Sum Sq>
>     <Df> 126</Df>
>     <F value>  1.440098</F value>
>     <Pr(>F)> 1.752742e-03</Pr(>F)>
>    </line>
>    <line>
>     7
>     <Factor>codec:Sample</Factor>
>     <Sum Sq>253.04055</Sum Sq>
>     <Df>  18</Df>
>     <F value> 75.417587</F value>
>     <Pr(>F)>4.055009e-180</Pr(>F)>
>    </line>
>    <line>
>     8
>     <Factor>Residuals</Factor>
>     <Sum Sq>214.73234</Sum Sq>
>     <Df>1152</Df>
>     <F value>NA</F value>
>     <Pr(>F)>NA</Pr(>F)>
>    </line>
>   </anova:2>
>  </anova>
> 
> for data I basically used the function xmlNode,addChildren,xmlchildren. I
> don't know if it's sufficient to recognise a xml file
> 
> 
> So thanks for your help!
> 
> 
> Regards,
> 
> Guillaume
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.




More information about the R-help mailing list