[R] generate XML

S Devriese sdmaillist at gmail.com
Thu Jan 7 10:41:08 CET 2010


On 01/07/2010 10:13 AM, Robert wrote:
> Finally, I managed to automatically generate rather simple XML code. In R this is a matrix. The problem concerns how to write that matrix to file. I use write.table and the extension of file .xml Everything works perfect beside coding some language letters (Polish). But the problem disappears when I change the extension to .txt Therefore I write a file with .txt extension and after that I manually change the extension to .xml  - it does not solve the problem. Is it possible to write my matrix or txt file to valid xml file? I need to do it automatically.
> 
> Best,
> Robert  
> 
> ______________________________________________
> 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.

Have you checked the XML package?

If you print the matrix within R, this it look like you want (including
correct langauge encoding? Because in that case, you probably could use
sink (see ?sink).

Stephan



More information about the R-help mailing list