[R] problem with odfWeave

Sarah Goslee sarah.goslee at gmail.com
Wed Jan 6 19:12:15 CET 2010


Hi Joel,

If you actually want to make a table, you need to use odfTable. There
are examples
in the help for that function. Same for odfCat, but instead of
creating a table, that will
print your output.

eg to print your output:

<<echo=FALSE>>=
    odfCat("some random normal data:", rnorm(5)) # from the help file
@

or to make a table:

<<echo=FALSE>>=
    x <- matrix(1:12, ncol=3)
    colnames(x) <- c("a", "b", "c")
    odfTable(x)
    odfTableCaption("A useless table")
@

ODT files are actually compressed XML files. If you just print from
within R, there are no
XML tags around your output and OpenOffice has no idea what to do with it. The
various odfSomething R functions wrap the R output in XML tags so OOo will
understand it in the final output.

Sarah

On Wed, Jan 6, 2010 at 12:41 PM, Joel GOMBIN <joel.gombin at gmail.com> wrote:
> Hello,
>
> I have encountered problems using odfdWeave. I actually have the same error
> message as was reported in this message (
> http://tolstoy.newcastle.edu.au/R/e6/help/09/01/0872.html), but I don't
> quite understand the answer made by Max Kuhn ("You need to cat the results
> using odfCAt, otherwise you are just writing the output with no XML around
> it."). What I am supposed to do exactly ?
>
> What I'm trying to do is writing values I have computed earlier in the cells
> of a table in an ODT file.
>
> I'm very grateful in advance for any help...
>


-- 
Sarah Goslee
http://www.functionaldiversity.org



More information about the R-help mailing list