[R] odfweave

2008-11-12 Thread Irina Ursachi
Dear all,

I am trying to use the function odfWeave. Unfortunately I cannot get
beyond the folllowing error message:
"
Error in odfWeave("Example3.rnw", "Example3.odf") :
  Error unzipping odt file
"
Can anybody tell me, how to use this function?

Thanks,
Irina Ursachi.

__
R-help@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.


[R] Odfweave

2009-02-24 Thread Irina Ursachi
Dear all,

When using odfWeave, I get the following error:

odfWeave(file.in,file.out)
  Copying  Example2.odt
  Setting wd to  /tmp/Rtmp8ekeDC/odfWeave24145003519
  Unzipping ODF file using unzip -o Example2.odt
Archive:  Example2.odt
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of Example2.odt or
Example2.odt.zip, and cannot find Example2.odt.ZIP, period.
Error in odfWeave(file.in, file.out) : Error unzipping odt file

Does anybody know why? Thanks in advance!

Best regards,
Irina Ursachi.

__
R-help@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.


[R] odfWeave error

2007-12-02 Thread Cleber N. Borges

hello all,
I trying to use the package 'odfWeave'
and I get the follow error:



###  error message
#
...
  Removing content.xml

  Post-processing the contents
Error in .Call("RS_XML_Parse", file, handlers, as.logical(addContext),  :
  Error in the XML event driven parser for content_1.xml: error parsing 
attribute name



The piece of the code is:

###  code

...

<>=
fileplot='C:\\DADOS\\tmp\\plotx.emf'
win.metafile(fileplot)
plot( rnorm(300), col='red', t='l', lwd=2 ); grid()
dev.off()
@

<>=
odfInsertPlot(file=fileplot, height=5, width=5 )
@




[[replacing trailing spam]]
Cleber Borges

### sessionInfo

 >
 > sessionInfo()
R version 2.6.1 (2007-11-26)
i386-pc-mingw32

locale:
LC_COLLATE=C;LC_CTYPE=C;LC_MONETARY=Portuguese_Brazil.1252;LC_NUMERIC=C;LC_TIME=Portuguese_Brazil.1252

attached base packages:
[1] grid  stats graphics  grDevices utils datasets  
methods   base

other attached packages:
[1] MASS_7.2-38odfWeave_0.6.0 XML_1.93-2.1   lattice_0.17-2

loaded via a namespace (and not attached):
[1] rcompgen_0.1-17 tools_2.6.1   
 >







___ 

Experimente já e veja as novidades.

__
R-help@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.


[R] odfWeave \Sexpr

2008-04-17 Thread Schnitzler, Johannes
Dear All,

Using odfWeave is working fine for me using code chunks <<...>>= ... @

But the inline \Sexpr{date()} is not evaluated and returns again
\Sexpr{date()} instead of   "Thu Apr 17 18:15:47 2008".

What might be the reason for that, what do I have to look for?

I'm using Windows XP, R 2.6.1, odfWeave_0.7.3 and OpenOffice 2.4.

Session Info:

R version 2.6.1 (2007-11-26) 
i386-pc-mingw32 

locale:
LC_COLLATE=C;LC_CTYPE=C;LC_MONETARY=English_United
Kingdom.1252;LC_NUMERIC=C;LC_TIME=English_United Kingdom.1252

attached base packages:
[1] grid  stats graphics  grDevices utils datasets  methods

[8] base 

other attached packages:
[1] odfWeave_0.7.3 MASS_7.2-41foreign_0.8-23
RColorBrewer_1.0-2
[5] abind_1.1-0R2HTML_1.58RODBC_1.2-3
XML_1.93-2.2  
[9] lattice_0.17-6

loaded via a namespace (and not attached):
[1] tools_2.6.1

Thank you very much

Johannes

__
R-help@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.


[R] odfWeave error

2008-10-23 Thread Rob James
odfWeave is throwing up a cryptic error, after successfully processing a 
file with a large number of figures (~30) and many \Sexpr{} calls.  The 
error is (at least to me) cryptic. I am not sure where to look to 
correct this problem.


Here's the error:


Post-processing the contents
Error in .Call("RS_XML_Parse", file, handlers, endElementHandlers, 
as.logical(addContext),  :

 attempt to apply non-function


Is there any way to figure out what this means, or where I might look 
for the error in the source?


Here's a capture of the associated log. I am running R 2.8 under Ubuntu 
8.04.



Thanks,


> odfWeave("/home/rob/Trauma/Report_2_draft.odt", 
"/home/rob/Trauma/Report_2_draft_out.odt")

 Copying  /home/rob/Trauma/Report_2_draft.odt
 Setting wd to  /tmp/Rtmp2tlRz0/odfWeave23115040235
 Unzipping ODF file using unzip -o Report_2_draft.odt
Archive:  Report_2_draft.odt
extracting: mimetype   
  creating: Configurations2/statusbar/
 inflating: Configurations2/accelerator/current.xml 
  creating: Configurations2/floater/

  creating: Configurations2/popupmenu/
  creating: Configurations2/progressbar/
  creating: Configurations2/menubar/
  creating: Configurations2/toolbar/
  creating: Configurations2/images/Bitmaps/
 inflating: layout-cache   
 inflating: content.xml
 inflating: styles.xml 
extracting: meta.xml   
 inflating: Thumbnails/thumbnail.png 
 inflating: settings.xml   
 inflating: META-INF/manifest.xml  


 Removing  Report_2_draft.odt
 Creating a Pictures directory

 Pre-processing the contents
 Sweaving  content.Rnw

 Writing to file content_1.xml
 Processing code chunks ...
   1 : term hide(label=loadData)
d2 : term verbatim(label=SiteHist)
ate()
   3 : term verbatim(label=AgeSex)
   4 : term verbatim(label=Sitesex)
   5 : term verbatim(label=SiteHeadNeck)
   6 : term verbatim(label=SiteFace)
   7 : term verbatim(label=SiteChest)
   8 : term verbatim(label=SiteAbdomnen)
   9 : term verbatim(label=SiteGCS_Eyes)
  10 : term verbatim(label=SiteGCS_Verbal)
  11 : term verbatim(label=SiteGCS_Motor)
  12 : term verbatim(label=SiteGCS_total)
  13 : term verbatim(label=SBP)
  14 : term verbatim(label=DBP)
  15 : term verbatim(label=HR)
  16 : term verbatim(label=RESPIRATION)
  17 : term verbatim(label=PF_ADMIT)
  18 : term verbatim(label=O2_admit)
  19 : term verbatim(label=Ph_admit)
  20 : term verbatim(label=DEFICIT)
  21 : term verbatim(label=lactic_acid)

 'content_1.xml' has been Sweaved

 Removing content.xml

 Post-processing the contents
Error in .Call("RS_XML_Parse", file, handlers, endElementHandlers, 
as.logical(addContext),  :

 attempt to apply non-function
In addition: There were 50 or more warnings (use warnings() to see the 
first 50)

> date()
[1] "Thu Oct 23 12:18:18 2008"

__
R-help@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.


[R] odfWeave error

2008-10-23 Thread Rob James
Sender: [EMAIL PROTECTED]
On-Behalf-Of: [EMAIL PROTECTED]
Subject: [R] odfWeave error
Message-Id: <[EMAIL PROTECTED]>
Recipient: [EMAIL PROTECTED]




This information is being sent at the recipient's request or with their 
specific understanding. The recipient acknowledges that by sending this 
information via electronic means, there is no absolute assurance that the 
information will be free from third party access, use, or further 
dissemination. This e-mail contains information that is privileged and/or 
confidential and may be subject to legal restrictions and penalties regarding 
its unauthorized disclosure or other use. You are prohibited from copying, 
distributing or otherwise using this information if you are not the intended 
recipient. Past performance is not necessarily indicative of future results. 
This is not an offer of or the solicitation for any security which will be made 
only by private placement memorandum that may be obtained from the applicable 
hedge fund. If you have received this e-mail in error, please notify us 
immediately by return e-mail and delete this e-mail and all attachments from 
your system. Thank You.
--- Begin Message ---
odfWeave is throwing up a cryptic error, after successfully processing a 
file with a large number of figures (~30) and many \Sexpr{} calls.  The 
error is (at least to me) cryptic. I am not sure where to look to 
correct this problem.


Here's the error:


Post-processing the contents
Error in .Call("RS_XML_Parse", file, handlers, endElementHandlers, 
as.logical(addContext),  :

 attempt to apply non-function


Is there any way to figure out what this means, or where I might look 
for the error in the source?


Here's a capture of the associated log. I am running R 2.8 under Ubuntu 
8.04.



Thanks,


> odfWeave("/home/rob/Trauma/Report_2_draft.odt", 
"/home/rob/Trauma/Report_2_draft_out.odt")

 Copying  /home/rob/Trauma/Report_2_draft.odt
 Setting wd to  /tmp/Rtmp2tlRz0/odfWeave23115040235
 Unzipping ODF file using unzip -o Report_2_draft.odt
Archive:  Report_2_draft.odt
extracting: mimetype   
  creating: Configurations2/statusbar/
 inflating: Configurations2/accelerator/current.xml 
  creating: Configurations2/floater/

  creating: Configurations2/popupmenu/
  creating: Configurations2/progressbar/
  creating: Configurations2/menubar/
  creating: Configurations2/toolbar/
  creating: Configurations2/images/Bitmaps/
 inflating: layout-cache   
 inflating: content.xml
 inflating: styles.xml 
extracting: meta.xml   
 inflating: Thumbnails/thumbnail.png 
 inflating: settings.xml   
 inflating: META-INF/manifest.xml  


 Removing  Report_2_draft.odt
 Creating a Pictures directory

 Pre-processing the contents
 Sweaving  content.Rnw

 Writing to file content_1.xml
 Processing code chunks ...
   1 : term hide(label=loadData)
d2 : term verbatim(label=SiteHist)
ate()
   3 : term verbatim(label=AgeSex)
   4 : term verbatim(label=Sitesex)
   5 : term verbatim(label=SiteHeadNeck)
   6 : term verbatim(label=SiteFace)
   7 : term verbatim(label=SiteChest)
   8 : term verbatim(label=SiteAbdomnen)
   9 : term verbatim(label=SiteGCS_Eyes)
  10 : term verbatim(label=SiteGCS_Verbal)
  11 : term verbatim(label=SiteGCS_Motor)
  12 : term verbatim(label=SiteGCS_total)
  13 : term verbatim(label=SBP)
  14 : term verbatim(label=DBP)
  15 : term verbatim(label=HR)
  16 : term verbatim(label=RESPIRATION)
  17 : term verbatim(label=PF_ADMIT)
  18 : term verbatim(label=O2_admit)
  19 : term verbatim(label=Ph_admit)
  20 : term verbatim(label=DEFICIT)
  21 : term verbatim(label=lactic_acid)

 'content_1.xml' has been Sweaved

 Removing content.xml

 Post-processing the contents
Error in .Call("RS_XML_Parse", file, handlers, endElementHandlers, 
as.logical(addContext),  :

 attempt to apply non-function
In addition: There were 50 or more warnings (use warnings() to see the 
first 50)

> date()
[1] "Thu Oct 23 12:18:18 2008"

__
R-help@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.
--- End Message ---
__
R-help@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.


Re: [R] odfweave

2008-11-12 Thread Shige Song
You are probably using Windows and do not have a compatible unzip program on
your path.

Shige

On Wed, Nov 12, 2008 at 8:01 AM, Irina Ursachi <
[EMAIL PROTECTED]> wrote:

> Dear all,
>
> I am trying to use the function odfWeave. Unfortunately I cannot get
> beyond the folllowing error message:
> "
> Error in odfWeave("Example3.rnw", "Example3.odf") :
>  Error unzipping odt file
> "
> Can anybody tell me, how to use this function?
>
> Thanks,
> Irina Ursachi.
>
> __
> R-help@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.
>

[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] odfweave

2008-11-12 Thread Sarah Goslee
Your input file should be an OpenOffice document; is it? rnw is not an OO
extension. The second file should likely have an odt rather than odf
extension as well, but that woudn't cause the error you're getting.

Sarah

On Wed, Nov 12, 2008 at 11:01 AM, Irina Ursachi
<[EMAIL PROTECTED]> wrote:
> Dear all,
>
> I am trying to use the function odfWeave. Unfortunately I cannot get
> beyond the folllowing error message:
> "
> Error in odfWeave("Example3.rnw", "Example3.odf") :
>  Error unzipping odt file
> "
> Can anybody tell me, how to use this function?
>
> Thanks,
> Irina Ursachi.
>



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

__
R-help@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.


[R] odfWeave & prettyR

2009-02-13 Thread lauramorg...@bluewin.ch
Hello,
I've been trying to use odfWeave and prettyR packages to create documents with 
both text and graphs, but so far I 
haven't been very lucky...
With the function R2html () in prettyR package, when I try to use a source 
file, which works perfectly if I run it 
directly form R using "source("file")", 
it works for the first part and then it makes a mess, i guess something might 
be wrong in my formatting or the 
function R2html doesnt recognize the function if()
because i get errors like this one
"Error in parse(cmdcon) : unexpected 'if' at
1: for (i in 1:length(resultList)){tempSummary <- 
try(summary(resultList[[i]]), silent = TRUE)if"

everytime there is a if.

I tried with the function htmlize and it works for the text (like summaries) 
but I didn't manage to get the plots on 
the html file
I tried to use the funcion HTMLgraph but I couldn't understand what it does and 
what its arguments are (listfile, 
graphfile)

With odfWeave I tried to download it, and saw that it depends on XML package. 
If I try to load the odfWeave package 
with
library(odfWeave) I get this message:

Loading: XML
Error: package 'XML' not loaded
Warning message:
In library(pkg, character.only = TRUE, logical.return = TRUE, lib.loc = 
lib.loc) :
 there is no 'XML' package

The problem is that on the CRAN web site the XML package is not available for 
windows...
Any suggestions?
Thanks and sorry for bothering you all again with this subject...

__
R-help@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.


Re: [R] Odfweave

2009-02-24 Thread Dieter Menne
Irina Ursachi  itwm.fraunhofer.de> writes:

> 
> Dear all,
> 
> When using odfWeave, I get the following error:
> 
> odfWeave(file.in,file.out)
>   Copying  Example2.odt
>   Setting wd to  /tmp/Rtmp8ekeDC/odfWeave24145003519
>   Unzipping ODF file using unzip -o Example2.odt
> Archive:  Example2.odt
>   End-of-central-directory signature not found.  Either this file is not
>   a zipfile, or it constitutes one disk of a multi-part archive.  In the
>   latter case the central directory and zipfile comment will be found on
>   the last disk(s) of this archive.

If this is Windows: 

http://markmail.org/message/qsrqdtozizlngbrt

And please report back if it helped.

Dieter

__
R-help@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.


Re: [R] odfWeave error

2007-12-03 Thread Emmanuel Charpentier
Cleber N. Borges a écrit :
> hello all,
> I trying to use the package 'odfWeave'
> and I get the follow error:
> 
> 
> 
> ###  error message
> #
> ...
>   Removing content.xml
> 
>   Post-processing the contents
> Error in .Call("RS_XML_Parse", file, handlers, as.logical(addContext),  :
>   Error in the XML event driven parser for content_1.xml: error parsing 
> attribute name
> 
> 
> 
> The piece of the code is:
> 
> ###  code
> 
> ...
> 
> <>=
> fileplot='C:\\DADOS\\tmp\\plotx.emf'
> win.metafile(fileplot)
> plot( rnorm(300), col='red', t='l', lwd=2 ); grid()
> dev.off()
> @

 This chunk is pure R code and shouldn't output anything directly in
the output file. Since you are telling "echo=T', whatever is output by
your code is sent to your output file, and since you assert
"results=xml",this output is interpreted as xml ; since this isn't XML,
your're getting guff from the XML interpreter.

I'd rather do :
<>=
invisible({
# Whatever you did ...
})
@
instead. Your second chunk :

> <>=
> odfInsertPlot(file=fileplot, height=5, width=5 )
> @

should insert your plot in the output file.

[Snip ... ]

BTW : Windows (enhanced) metafile are Windows-specific. As far as I can
tell, recent versions of Office and OpenOffice.org correctly render
Encapsulated Postcript files, thus freeing you from another Windows
demendency. Unless you *have* to have an EMF output (it happens, I know
...), youd'better use use this format directly.

HTH

Emmanuel Charpentier

__
R-help@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.


[R] odfWeave cross-reference

2007-12-21 Thread Chris.H. Snow
How can I insert cross-references to odfWeave generated figures in my
source odf before the graphic has been created with odfWeave?

Many thanks,

Chris

__
R-help@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.


[R] odfWeave and xtable

2008-01-12 Thread 宋时歌
Dear All,

I am new to odfWeave and was wondering if there are something similar
to the xtable package that can automatically convert model
coefficients into LaTeX/ODT tables?  More generally, how do people who
use odfWeave transform model results into tables? The odfTable does
not seem to be able to do this (maybe I am wrong, and would appreciate
some demos). Thanks.

Best,
Shige

__
R-help@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.


[R] odfWeave learning resources

2008-12-16 Thread Tubin

In general I try not to post questions to forums until I've tried my best to
read about them in the available documentation.  I recently undertook a
project that used odfWeave and have been very pleased with the package. 
But, the R help documentation suggests that there are more sophisticated
things I can do - for example, with conditionally formatted tables.  

Can anyone point me to resources I could review to educate myself about the
full capabilities of this lovely package?

Thanks!
-- 
View this message in context: 
http://www.nabble.com/odfWeave-learning-resources-tp21041939p21041939.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@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.


Re: [R] odfWeave \Sexpr

2008-04-17 Thread Schnitzler, Johannes
 

Dear All,

After doing more "try and error" ...
This problem occurred as I was loading R2HTML before the odfWeave function.
This issue is also described in the Sweave FAQ.

From the FAQ
<>
Best regards
Johannes


On Thu, Apr 17, 2008 at 12:30 PM, Schnitzler, Johannes <[EMAIL PROTECTED]> 
wrote:
> Dear All,
>
>  Using odfWeave is working fine for me using code chunks <<...>>= ... 
> @
>
>  But the inline \Sexpr{date()} is not evaluated and returns again
>  \Sexpr{date()} instead of   "Thu Apr 17 18:15:47 2008".
>
>  What might be the reason for that, what do I have to look for?
>
>  I'm using Windows XP, R 2.6.1, odfWeave_0.7.3 and OpenOffice 2.4.
>
>  Session Info:
>
>  R version 2.6.1 (2007-11-26)
>  i386-pc-mingw32
>
>  locale:
>  LC_COLLATE=C;LC_CTYPE=C;LC_MONETARY=English_United
>  Kingdom.1252;LC_NUMERIC=C;LC_TIME=English_United Kingdom.1252
>
>  attached base packages:
>  [1] grid  stats graphics  grDevices utils datasets  methods
>
>  [8] base
>
>  other attached packages:
>  [1] odfWeave_0.7.3 MASS_7.2-41foreign_0.8-23
>  RColorBrewer_1.0-2
>  [5] abind_1.1-0R2HTML_1.58RODBC_1.2-3
>  XML_1.93-2.2
>  [9] lattice_0.17-6
>
>  loaded via a namespace (and not attached):
>  [1] tools_2.6.1
>
>  Thank you very much
>
>  Johannes
>
>  __
>  R-help@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.
>



-- 

Max
__
R-help@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.


Re: [R] odfWeave error

2008-10-23 Thread Duncan Murdoch

On 10/23/2008 3:32 PM, Rob James wrote:
odfWeave is throwing up a cryptic error, after successfully processing a 
file with a large number of figures (~30) and many \Sexpr{} calls.  The 
error is (at least to me) cryptic. I am not sure where to look to 
correct this problem.


Here's the error:


Post-processing the contents
Error in .Call("RS_XML_Parse", file, handlers, endElementHandlers, 
as.logical(addContext),  :

  attempt to apply non-function


That's a relatively difficult error to get:  I think you usually need to 
be messing around with expressions to see it.  You can also get it in 
simpler ways with nonsensical expressions, like


> 1(1)
Error: attempt to apply non-function

I'd say you'll need to do a traceback() to find out where this is coming 
from.  It's probably also worthwhile to track down those warnings() that 
you were told about.


Duncan Murdoch




Is there any way to figure out what this means, or where I might look 
for the error in the source?


Here's a capture of the associated log. I am running R 2.8 under Ubuntu 
8.04.



Thanks,


 > odfWeave("/home/rob/Trauma/Report_2_draft.odt", 
"/home/rob/Trauma/Report_2_draft_out.odt")

  Copying  /home/rob/Trauma/Report_2_draft.odt
  Setting wd to  /tmp/Rtmp2tlRz0/odfWeave23115040235
  Unzipping ODF file using unzip -o Report_2_draft.odt
Archive:  Report_2_draft.odt
 extracting: mimetype   
   creating: Configurations2/statusbar/
  inflating: Configurations2/accelerator/current.xml 
   creating: Configurations2/floater/

   creating: Configurations2/popupmenu/
   creating: Configurations2/progressbar/
   creating: Configurations2/menubar/
   creating: Configurations2/toolbar/
   creating: Configurations2/images/Bitmaps/
  inflating: layout-cache   
  inflating: content.xml
  inflating: styles.xml 
 extracting: meta.xml   
  inflating: Thumbnails/thumbnail.png 
  inflating: settings.xml   
  inflating: META-INF/manifest.xml  


  Removing  Report_2_draft.odt
  Creating a Pictures directory

  Pre-processing the contents
  Sweaving  content.Rnw

  Writing to file content_1.xml
  Processing code chunks ...
1 : term hide(label=loadData)
d2 : term verbatim(label=SiteHist)
ate()
3 : term verbatim(label=AgeSex)
4 : term verbatim(label=Sitesex)
5 : term verbatim(label=SiteHeadNeck)
6 : term verbatim(label=SiteFace)
7 : term verbatim(label=SiteChest)
8 : term verbatim(label=SiteAbdomnen)
9 : term verbatim(label=SiteGCS_Eyes)
   10 : term verbatim(label=SiteGCS_Verbal)
   11 : term verbatim(label=SiteGCS_Motor)
   12 : term verbatim(label=SiteGCS_total)
   13 : term verbatim(label=SBP)
   14 : term verbatim(label=DBP)
   15 : term verbatim(label=HR)
   16 : term verbatim(label=RESPIRATION)
   17 : term verbatim(label=PF_ADMIT)
   18 : term verbatim(label=O2_admit)
   19 : term verbatim(label=Ph_admit)
   20 : term verbatim(label=DEFICIT)
   21 : term verbatim(label=lactic_acid)

  'content_1.xml' has been Sweaved

  Removing content.xml

  Post-processing the contents
Error in .Call("RS_XML_Parse", file, handlers, endElementHandlers, 
as.logical(addContext),  :

  attempt to apply non-function
In addition: There were 50 or more warnings (use warnings() to see the 
first 50)

 > date()
[1] "Thu Oct 23 12:18:18 2008"

__
R-help@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.


__
R-help@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.


Re: [R] odfWeave error

2008-10-23 Thread Duncan Temple Lang



Duncan Murdoch wrote:

On 10/23/2008 3:32 PM, Rob James wrote:
odfWeave is throwing up a cryptic error, after successfully processing 
a file with a large number of figures (~30) and many \Sexpr{} calls.  
The error is (at least to me) cryptic. I am not sure where to look to 
correct this problem.


Here's the error:


Post-processing the contents
Error in .Call("RS_XML_Parse", file, handlers, endElementHandlers, 
as.logical(addContext),  :

  attempt to apply non-function


That's a relatively difficult error to get:  I think you usually need to 
be messing around with expressions to see it.  You can also get it in 
simpler ways with nonsensical expressions, like


 > 1(1)
Error: attempt to apply non-function

I'd say you'll need to do a traceback() to find out where this is coming 
from.  It's probably also worthwhile to track down those warnings() that 
you were told about.



The most likely cause is that one of the elements of the
handlers object is not a function.
The XML parser expects each element that will be called
when a corresponding node is encountered in the XML content
to be a function.

I'd take a look at the value of handlers and see which
of them is not a function and where the list is being
constructed.

(Other)  Duncan




Duncan Murdoch




Is there any way to figure out what this means, or where I might look 
for the error in the source?


Here's a capture of the associated log. I am running R 2.8 under 
Ubuntu 8.04.



Thanks,


 > odfWeave("/home/rob/Trauma/Report_2_draft.odt", 
"/home/rob/Trauma/Report_2_draft_out.odt")

  Copying  /home/rob/Trauma/Report_2_draft.odt
  Setting wd to  /tmp/Rtmp2tlRz0/odfWeave23115040235
  Unzipping ODF file using unzip -o Report_2_draft.odt
Archive:  Report_2_draft.odt
 extracting: mimetype  creating: 
Configurations2/statusbar/
  inflating: Configurations2/accelerator/current.xmlcreating: 
Configurations2/floater/

   creating: Configurations2/popupmenu/
   creating: Configurations2/progressbar/
   creating: Configurations2/menubar/
   creating: Configurations2/toolbar/
   creating: Configurations2/images/Bitmaps/
  inflating: layout-cache inflating: 
content.xml  inflating: styles.xml 
 extracting: meta.xml inflating: 
Thumbnails/thumbnail.png   inflating: settings.xml 
inflating: META-INF/manifest.xml 
  Removing  Report_2_draft.odt

  Creating a Pictures directory

  Pre-processing the contents
  Sweaving  content.Rnw

  Writing to file content_1.xml
  Processing code chunks ...
1 : term hide(label=loadData)
d2 : term verbatim(label=SiteHist)
ate()
3 : term verbatim(label=AgeSex)
4 : term verbatim(label=Sitesex)
5 : term verbatim(label=SiteHeadNeck)
6 : term verbatim(label=SiteFace)
7 : term verbatim(label=SiteChest)
8 : term verbatim(label=SiteAbdomnen)
9 : term verbatim(label=SiteGCS_Eyes)
   10 : term verbatim(label=SiteGCS_Verbal)
   11 : term verbatim(label=SiteGCS_Motor)
   12 : term verbatim(label=SiteGCS_total)
   13 : term verbatim(label=SBP)
   14 : term verbatim(label=DBP)
   15 : term verbatim(label=HR)
   16 : term verbatim(label=RESPIRATION)
   17 : term verbatim(label=PF_ADMIT)
   18 : term verbatim(label=O2_admit)
   19 : term verbatim(label=Ph_admit)
   20 : term verbatim(label=DEFICIT)
   21 : term verbatim(label=lactic_acid)

  'content_1.xml' has been Sweaved

  Removing content.xml

  Post-processing the contents
Error in .Call("RS_XML_Parse", file, handlers, endElementHandlers, 
as.logical(addContext),  :

  attempt to apply non-function
In addition: There were 50 or more warnings (use warnings() to see the 
first 50)

 > date()
[1] "Thu Oct 23 12:18:18 2008"

__
R-help@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.


__
R-help@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.


__
R-help@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.


Re: [R] odfWeave error

2008-10-23 Thread Dieter Menne
Rob James  aetiologic.ca> writes:

> Post-processing the contents
> Error in .Call("RS_XML_Parse", file, handlers, endElementHandlers, 
> as.logical(addContext),  :
>   attempt to apply non-function
> 

This might be similar to:

http://finzi.psych.upenn.edu/R/Rhelp02a/archive/135891.html

and could happen if you use umlauts or other special characters. You might try
to download XML 1.9.0 (older version) to check if it is the problem.

Dieter

__
R-help@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.


Re: [R] odfWeave error

2008-10-24 Thread Max Kuhn
Rob,

> Post-processing the contents
> Error in .Call("RS_XML_Parse", file, handlers, endElementHandlers,
> as.logical(addContext),  :
>  attempt to apply non-function

Can you do these three things?

1. Send the results of sessionInfo()?
2. Try to run the code in the code chunks outside of odfWeave and make
sure that they work.
3. Send me an odt file that reproduces the error (blind the data etc)

Thanks,

Max

__
R-help@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.


Re: [R] odfWeave & prettyR

2009-02-13 Thread Dieter Menne
lauramorgana  bluewin.ch  bluewin.ch> writes:

> 
> Hello,
> I've been trying to use odfWeave and prettyR packages to create documents with
both text and graphs, but so far I  haven't been very lucky...

...
> library(odfWeave) I get this message:
> 
> Loading: XML
> Error: package 'XML' not loaded

> The problem is that on the CRAN web site the XML package is not available for
windows...

I just checked, and it is available for Windows from my mirror (Austria) 
and from ETH (assuming you are CH).

However, there was a problem when using XML with Umlauts and the like
in a more recent version of XML on Windows (and on Windows only).

So after you installed XML (a must), first try with the odfWeave 
standard examples. If these work, add an äü somewhere, try again.


Dieter

__
R-help@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.


Re: [R] odfWeave & prettyR

2009-02-13 Thread Max Kuhn
>> The problem is that on the CRAN web site the XML package is not available for
> windows...
>
> I just checked, and it is available for Windows from my mirror (Austria)
> and from ETH (assuming you are CH).

I would use XML ~ v1.90 for windows to use with odfWeave. You can get it at:

 http://cran.us.r-project.org/bin/windows/contrib/2.5/

Max

__
R-help@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.


[R] odfWeave problem in 7.1?

2008-07-10 Thread Jim Porzak
Max & Friends,

I've run into a problem with odfWeave 0.7.5 running under R 2.7.1
(Windows XP, SP2) doing some monthly production reports.

Under 2.7.1 I'm getting various parsing errors after Sweaving starts, e.g.:

  Sweaving  content.Rnw

  Writing to file content_1.xml
  Processing code chunks ...
Error in parse(text = cmd) : unexpected input in ""
>

Above case works fine under 2.6.2:

 Sweaving  content.Rnw

  Writing to file content_1.xml
  Processing code chunks ...
1 : term xml(label=MissingTable)
2 : term xml(label=UnusualTable)
3 : term verbatim(label=MembCounts)
4 : term verbatim(label=UsageCounts)
5 : term verbatim(label=SessionsCounts)
6 : term verbatim(label=SR_MembershipCounts)
7 : term verbatim(label=MiscCounts)

  'content_1.xml' has been Sweaved

  Removing content.xml

  Post-processing the contents
  Removing content.Rnw
  Removing styles.xml
  Renaming styles_2.xml to styles.xml
  Removing extra files

  Packaging file using zip -r "24HF_MonthlyLoadQA20Counts_Source.odt" .
  Copying  24HF_MonthlyLoadQA20Counts_Source.odt
  Resetting wd
  Removing  C:/Data/24HF_QA/R/DocsPlots/Work

  Done
>

Any ideas?

TIA,
Jim Porzak
Responsys, Inc.
San Francisco, CA
http://www.linkedin.com/in/jimporzak

__
R-help@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.


Re: [R] odfWeave cross-reference

2007-12-23 Thread Emmanuel Charpentier
Chris.H. Snow a écrit :
> How can I insert cross-references to odfWeave generated figures in my
> source odf before the graphic has been created with odfWeave?

In the current (0.6.0) version, you can't. I wrote some modifications to
odfWeave in this direction, planning to send them back to Max Kuhn after
some testing, but am currently unable to work on them.

Basically, you have to separate the creation of a reference to a
table|figure from the creation of the table|figure itself. The simplest
way is to be able 1) to create some forme of R object containing the
necessary reference info, 2) to use such an R object in ordre to insert
the XML code for reference and|or 3) to pass such an object as an
optional argument to table|figure caption creation.

My current set of functions allows all of the above, but is not
correctly integrated in the package, and has not been tested extensively.

HTH,

Emmanuel Charpentier

__
R-help@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.


Re: [R] odfWeave and xtable

2008-01-12 Thread Frank E Harrell Jr
??? wrote:
> Dear All,
> 
> I am new to odfWeave and was wondering if there are something similar
> to the xtable package that can automatically convert model
> coefficients into LaTeX/ODT tables?  More generally, how do people who
> use odfWeave transform model results into tables? The odfTable does
> not seem to be able to do this (maybe I am wrong, and would appreciate
> some demos). Thanks.
> 
> Best,
> Shige

This is not related to tables, but see the latex methods in the Design 
package.  There are methods for using LaTeX to typeset various kinds of 
regression model fits.

Frank

-- 
Frank E Harrell Jr   Professor and Chair   School of Medicine
  Department of Biostatistics   Vanderbilt University

__
R-help@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.


Re: [R] odfWeave and xtable

2008-01-12 Thread Max Kuhn
One thing on my (neglected) to-do list for odfWeave is to create a
general class called odf that can be used to create output for common
models (lm, glm etc). The nice thing here is that the output from this
function could write mixed output. For example, a short paragraph
about the specified model, the table for coefficients produced by
summary.lm, diagnostic plots etc.

Right now, to get the coeffcient table use:

  #from ?lm
  ## Annette Dobson (1990) "An Introduction to Generalized Linear Models".
  ## Page 9: Plant Weight Data.
  ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14)
  trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69)
  group <- gl(2,10,20, labels=c("Ctl","Trt"))
  weight <- c(ctl, trt)
  lm.D9 <- lm(weight ~ group)

  library(odfWeave)
  coefTable <- summary(lm.D9)$coef
  colnames(coefTable) <- odfTranslate(colnames(coefTable), toR = FALSE)
  odfTable(coefTable)

Max

On Jan 12, 2008 1:03 PM, Frank E Harrell Jr <[EMAIL PROTECTED]> wrote:
> ??? wrote:
> > Dear All,
> >
> > I am new to odfWeave and was wondering if there are something similar
> > to the xtable package that can automatically convert model
> > coefficients into LaTeX/ODT tables?  More generally, how do people who
> > use odfWeave transform model results into tables? The odfTable does
> > not seem to be able to do this (maybe I am wrong, and would appreciate
> > some demos). Thanks.
> >
> > Best,
> > Shige
>
> This is not related to tables, but see the latex methods in the Design
> package.  There are methods for using LaTeX to typeset various kinds of
> regression model fits.
>

-- 

Max

__
R-help@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.


Re: [R] odfWeave and xtable

2008-01-12 Thread 宋时歌
Dear Max:

This is very helpful, thank you. By the way, nice work on odfWeave!

Best,
Shige

On Jan 13, 2008 4:09 AM, Max Kuhn <[EMAIL PROTECTED]> wrote:
> One thing on my (neglected) to-do list for odfWeave is to create a
> general class called odf that can be used to create output for common
> models (lm, glm etc). The nice thing here is that the output from this
> function could write mixed output. For example, a short paragraph
> about the specified model, the table for coefficients produced by
> summary.lm, diagnostic plots etc.
>
> Right now, to get the coeffcient table use:
>
>   #from ?lm
>   ## Annette Dobson (1990) "An Introduction to Generalized Linear Models".
>   ## Page 9: Plant Weight Data.
>   ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14)
>   trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69)
>   group <- gl(2,10,20, labels=c("Ctl","Trt"))
>   weight <- c(ctl, trt)
>   lm.D9 <- lm(weight ~ group)
>
>   library(odfWeave)
>   coefTable <- summary(lm.D9)$coef
>   colnames(coefTable) <- odfTranslate(colnames(coefTable), toR = FALSE)
>   odfTable(coefTable)
>
> Max
>
> On Jan 12, 2008 1:03 PM, Frank E Harrell Jr <[EMAIL PROTECTED]> wrote:
> > ??? wrote:
> > > Dear All,
> > >
> > > I am new to odfWeave and was wondering if there are something similar
> > > to the xtable package that can automatically convert model
> > > coefficients into LaTeX/ODT tables?  More generally, how do people who
> > > use odfWeave transform model results into tables? The odfTable does
> > > not seem to be able to do this (maybe I am wrong, and would appreciate
> > > some demos). Thanks.
> > >
> > > Best,
> > > Shige
> >
> > This is not related to tables, but see the latex methods in the Design
> > package.  There are methods for using LaTeX to typeset various kinds of
> > regression model fits.
> >
>
> --
>
> Max
>

__
R-help@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.


Re: [R] odfWeave and xtable

2008-01-13 Thread 宋时歌
Hi Frank,

I use Hmisc and Design in my research a lot, the LaTeX facilities are
very handy. But I don't think they can work with OpenOffice document
format (ODF), or did I miss something?

Thanks.

Shige

On Jan 13, 2008 2:03 AM, Frank E Harrell Jr <[EMAIL PROTECTED]> wrote:
>
> ??? wrote:
> > Dear All,
> >
> > I am new to odfWeave and was wondering if there are something similar
> > to the xtable package that can automatically convert model
> > coefficients into LaTeX/ODT tables?  More generally, how do people who
> > use odfWeave transform model results into tables? The odfTable does
> > not seem to be able to do this (maybe I am wrong, and would appreciate
> > some demos). Thanks.
> >
> > Best,
> > Shige
>
> This is not related to tables, but see the latex methods in the Design
> package.  There are methods for using LaTeX to typeset various kinds of
> regression model fits.
>
> Frank
>
> --
> Frank E Harrell Jr   Professor and Chair   School of Medicine
>   Department of Biostatistics   Vanderbilt University
>

__
R-help@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.


Re: [R] odfWeave and xtable

2008-01-13 Thread 宋时歌
Thanks, Frank. The clarification as well as the referred resources are
extremely helpful.

Shige

On Jan 13, 2008 10:14 PM, Frank E Harrell Jr <[EMAIL PROTECTED]> wrote:
> 宋时歌 wrote:
> > Hi Frank,
> >
> > I use Hmisc and Design in my research a lot, the LaTeX facilities are
> > very handy. But I don't think they can work with OpenOffice document
> > format (ODF), or did I miss something?
> >
> > Thanks.
> >
> > Shige
>
> You're correct.  Conversion from LaTeX to OpenOffice or Word is
> addressed at http://biostat.mc.vanderbilt.edu/SweaveConvert.  I have had
> good success opening the output of tth in Firefox and copying and
> pasting into OpenOffice, as this operation preserves all table and other
> formatting.
>
> When I wrote about latex(model fit) earlier I was referring to obtaining
> the algebraic form of a fitted model, handling such things as restricted
> cubic splines and factoring out variables in interaction terms.  The
> latex methods in Design do not produce tables of coefficients and
> standard errors.
>
> Frank
>
> >
> > On Jan 13, 2008 2:03 AM, Frank E Harrell Jr <[EMAIL PROTECTED]> wrote:
> >> ??? wrote:
> >>> Dear All,
> >>>
> >>> I am new to odfWeave and was wondering if there are something similar
> >>> to the xtable package that can automatically convert model
> >>> coefficients into LaTeX/ODT tables?  More generally, how do people who
> >>> use odfWeave transform model results into tables? The odfTable does
> >>> not seem to be able to do this (maybe I am wrong, and would appreciate
> >>> some demos). Thanks.
> >>>
> >>> Best,
> >>> Shige
> >> This is not related to tables, but see the latex methods in the Design
> >> package.  There are methods for using LaTeX to typeset various kinds of
> >> regression model fits.
> >>
> >> Frank
> >>
> >> --
> >> Frank E Harrell Jr   Professor and Chair   School of Medicine
> >>   Department of Biostatistics   Vanderbilt University
> >>
> >
>
>
> --
>
> Frank E Harrell Jr   Professor and Chair   School of Medicine
>   Department of Biostatistics   Vanderbilt University
>
__
R-help@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.


Re: [R] odfWeave and xtable

2008-01-13 Thread Frank E Harrell Jr
宋时歌 wrote:
> Hi Frank,
> 
> I use Hmisc and Design in my research a lot, the LaTeX facilities are
> very handy. But I don't think they can work with OpenOffice document
> format (ODF), or did I miss something?
> 
> Thanks.
> 
> Shige

You're correct.  Conversion from LaTeX to OpenOffice or Word is 
addressed at http://biostat.mc.vanderbilt.edu/SweaveConvert.  I have had 
good success opening the output of tth in Firefox and copying and 
pasting into OpenOffice, as this operation preserves all table and other 
formatting.

When I wrote about latex(model fit) earlier I was referring to obtaining 
the algebraic form of a fitted model, handling such things as restricted 
cubic splines and factoring out variables in interaction terms.  The 
latex methods in Design do not produce tables of coefficients and 
standard errors.

Frank

> 
> On Jan 13, 2008 2:03 AM, Frank E Harrell Jr <[EMAIL PROTECTED]> wrote:
>> ??? wrote:
>>> Dear All,
>>>
>>> I am new to odfWeave and was wondering if there are something similar
>>> to the xtable package that can automatically convert model
>>> coefficients into LaTeX/ODT tables?  More generally, how do people who
>>> use odfWeave transform model results into tables? The odfTable does
>>> not seem to be able to do this (maybe I am wrong, and would appreciate
>>> some demos). Thanks.
>>>
>>> Best,
>>> Shige
>> This is not related to tables, but see the latex methods in the Design
>> package.  There are methods for using LaTeX to typeset various kinds of
>> regression model fits.
>>
>> Frank
>>
>> --
>> Frank E Harrell Jr   Professor and Chair   School of Medicine
>>   Department of Biostatistics   Vanderbilt University
>>
> 


-- 
Frank E Harrell Jr   Professor and Chair   School of Medicine
  Department of Biostatistics   Vanderbilt University

__
R-help@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.


Re: [R] odfWeave and xtable

2008-01-15 Thread 宋时歌
Dear Max,

If you have plan to add more table making facilities into odfWeave
package, I suggest you base your work on Zelig, a R package that tries
to provide a unified interface to many existing R statistical
libraries, created by Gary King's team at Harvard. I see great
potential in this marriage.

Best,
Shige

On Jan 13, 2008 4:09 AM, Max Kuhn <[EMAIL PROTECTED]> wrote:
> One thing on my (neglected) to-do list for odfWeave is to create a
> general class called odf that can be used to create output for common
> models (lm, glm etc). The nice thing here is that the output from this
> function could write mixed output. For example, a short paragraph
> about the specified model, the table for coefficients produced by
> summary.lm, diagnostic plots etc.
>
> Right now, to get the coeffcient table use:
>
>   #from ?lm
>   ## Annette Dobson (1990) "An Introduction to Generalized Linear Models".
>   ## Page 9: Plant Weight Data.
>   ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14)
>   trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69)
>   group <- gl(2,10,20, labels=c("Ctl","Trt"))
>   weight <- c(ctl, trt)
>   lm.D9 <- lm(weight ~ group)
>
>   library(odfWeave)
>   coefTable <- summary(lm.D9)$coef
>   colnames(coefTable) <- odfTranslate(colnames(coefTable), toR = FALSE)
>   odfTable(coefTable)
>
> Max
>
> On Jan 12, 2008 1:03 PM, Frank E Harrell Jr <[EMAIL PROTECTED]> wrote:
> > ??? wrote:
> > > Dear All,
> > >
> > > I am new to odfWeave and was wondering if there are something similar
> > > to the xtable package that can automatically convert model
> > > coefficients into LaTeX/ODT tables?  More generally, how do people who
> > > use odfWeave transform model results into tables? The odfTable does
> > > not seem to be able to do this (maybe I am wrong, and would appreciate
> > > some demos). Thanks.
> > >
> > > Best,
> > > Shige
> >
> > This is not related to tables, but see the latex methods in the Design
> > package.  There are methods for using LaTeX to typeset various kinds of
> > regression model fits.
> >
>
> --
>
> Max
>

__
R-help@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.


Re: [R] odfWeave and xtable

2008-01-16 Thread David Hajage
It is verry easy with xtable package to make your own  "xtable.class"
function, if the "class" was not implemented in xtable package yet.
It would be wonderfull if odfWeave include a framework to make such things.

Ps : I would like to know if there is an R project to include all existing
format outputs (latex with Sweave, odf with odfWeave, html with rWeaveHTML)
and all the wonderful work of their author in a same package or in a same
project. All of these use a very similar syntax (<>= R code @), but
there is anyway a lot of work to rewrite the R code to make a file writes
for Sweave working with odfWeave. A latex file can be convert to latex or
rtf, but it depends on external programs not very easy to use.
For example, I would imagine an input similar to the syntax of help files
(.Rd), but the R code could be include (<< foo >>= R code @), and a
Sweave-like function could replace R code with results and convert the file
into latex, html or odf.

2008/1/16, ËÎʱ¸è <[EMAIL PROTECTED]>:
>
> Dear Max,
>
> If you have plan to add more table making facilities into odfWeave
> package, I suggest you base your work on Zelig, a R package that tries
> to provide a unified interface to many existing R statistical
> libraries, created by Gary King's team at Harvard. I see great
> potential in this marriage.
>
> Best,
> Shige
>
> On Jan 13, 2008 4:09 AM, Max Kuhn <[EMAIL PROTECTED]> wrote:
> > One thing on my (neglected) to-do list for odfWeave is to create a
> > general class called odf that can be used to create output for common
> > models (lm, glm etc). The nice thing here is that the output from this
> > function could write mixed output. For example, a short paragraph
> > about the specified model, the table for coefficients produced by
> > summary.lm, diagnostic plots etc.
> >
> > Right now, to get the coeffcient table use:
> >
> >   #from ?lm
> >   ## Annette Dobson (1990) "An Introduction to Generalized Linear
> Models".
> >   ## Page 9: Plant Weight Data.
> >   ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14)
> >   trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69)
> >   group <- gl(2,10,20, labels=c("Ctl","Trt"))
> >   weight <- c(ctl, trt)
> >   lm.D9 <- lm(weight ~ group)
> >
> >   library(odfWeave)
> >   coefTable <- summary(lm.D9)$coef
> >   colnames(coefTable) <- odfTranslate(colnames(coefTable), toR = FALSE)
> >   odfTable(coefTable)
> >
> > Max
> >
> > On Jan 12, 2008 1:03 PM, Frank E Harrell Jr <[EMAIL PROTECTED]>
> wrote:
> > > ??? wrote:
> > > > Dear All,
> > > >
> > > > I am new to odfWeave and was wondering if there are something
> similar
> > > > to the xtable package that can automatically convert model
> > > > coefficients into LaTeX/ODT tables?  More generally, how do people
> who
> > > > use odfWeave transform model results into tables? The odfTable does
> > > > not seem to be able to do this (maybe I am wrong, and would
> appreciate
> > > > some demos). Thanks.
> > > >
> > > > Best,
> > > > Shige
> > >
> > > This is not related to tables, but see the latex methods in the Design
> > > package.  There are methods for using LaTeX to typeset various kinds
> of
> > > regression model fits.
> > >
> >
> > --
> >
> > Max
> >
>
> __
> R-help@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.
>

[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] odfWeave and xtable

2008-01-16 Thread Max Kuhn
2008/1/16 David Hajage <[EMAIL PROTECTED]>:

> Ps : I would like to know if there is an R project to include all existing
> format outputs (latex with Sweave, odf with odfWeave, html with rWeaveHTML)
> and all the wonderful work of their author in a same package or in a same
> project. All of these use a very similar syntax (<>= R code @), but
> there is anyway a lot of work to rewrite the R code to make a file writes
> for Sweave working with odfWeave. A latex file can be convert to latex or
> rtf, but it depends on external programs not very easy to use.
> For example, I would imagine an input similar to the syntax of help files
> (.Rd), but the R code could be include (<< foo >>= R code @), and a

When developing odfWeave, I did run into issues that could not be
taken into account with Sweave. That is why odfWeave calls Sweave
instead of using Sweave directly (as you would with the R2HTML
package). It would be nice to have a more uniform/expanded interface
in Sweave that can more naturally accommodate other types of markup
(beyond writing drivers).

> Sweave-like function could replace R code with results and convert the file
> into latex, html or odf.

I *think* that odfWeave with OpenOffice/NeoOffice can do that. I think
I saw somewhere that newer versions of OO support LaTex, but clearly I
haven't looked into it. I do know that using OO as a conversion tool
to rtf, doc, pdf and html works very well.

-- 

Max

__
R-help@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.


Re: [R] odfWeave and xtable

2008-01-17 Thread David Hajage
yes, but we loose the possibility to use a 'simple' text editor. For
example, I like to use emacs+ess to edit and evaluate R code, and to write
my report in the same editor.
I like the idea that the input format could be writen with a simple text
editor, and the output format be chosen after. I know that the syntax of the
input file could be too difficult for newbie users (that's why odfWeave is
very usefull), but this can be bypass a specific editor like kile for
latex...

2008/1/16, Max Kuhn <[EMAIL PROTECTED]>:
>
> 2008/1/16 David Hajage <[EMAIL PROTECTED]>:
>
> > Ps : I would like to know if there is an R project to include all
> existing
> > format outputs (latex with Sweave, odf with odfWeave, html with
> rWeaveHTML)
> > and all the wonderful work of their author in a same package or in a
> same
> > project. All of these use a very similar syntax (<>= R code @), but
> > there is anyway a lot of work to rewrite the R code to make a file
> writes
> > for Sweave working with odfWeave. A latex file can be convert to latex
> or
> > rtf, but it depends on external programs not very easy to use.
> > For example, I would imagine an input similar to the syntax of help
> files
> > (.Rd), but the R code could be include (<< foo >>= R code @), and a
>
> When developing odfWeave, I did run into issues that could not be
> taken into account with Sweave. That is why odfWeave calls Sweave
> instead of using Sweave directly (as you would with the R2HTML
> package). It would be nice to have a more uniform/expanded interface
> in Sweave that can more naturally accommodate other types of markup
> (beyond writing drivers).
>
> > Sweave-like function could replace R code with results and convert the
> file
> > into latex, html or odf.
>
> I *think* that odfWeave with OpenOffice/NeoOffice can do that. I think
> I saw somewhere that newer versions of OO support LaTex, but clearly I
> haven't looked into it. I do know that using OO as a conversion tool
> to rtf, doc, pdf and html works very well.
>
> --
>
> Max
>

[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] odfWeave and xtable

2008-01-17 Thread 宋时歌
David,

The value of odfWeave is not limited to newbie users. It is vastly
useful for researchers in fields that do not accept LaTeX for journal
paper submission (for example, sociology, demography).

Best,
Shige

On Jan 17, 2008 5:46 PM, David Hajage <[EMAIL PROTECTED]> wrote:
> yes, but we loose the possibility to use a 'simple' text editor. For
> example, I like to use emacs+ess to edit and evaluate R code, and to write
> my report in the same editor.
> I like the idea that the input format could be writen with a simple text
> editor, and the output format be chosen after. I know that the syntax of the
> input file could be too difficult for newbie users (that's why odfWeave is
> very usefull), but this can be bypass a specific editor like kile for
> latex...
>
> 2008/1/16, Max Kuhn <[EMAIL PROTECTED]>:
>
> >
> > 2008/1/16 David Hajage <[EMAIL PROTECTED]>:
> >
> > > Ps : I would like to know if there is an R project to include all
> > existing
> > > format outputs (latex with Sweave, odf with odfWeave, html with
> > rWeaveHTML)
> > > and all the wonderful work of their author in a same package or in a
> > same
> > > project. All of these use a very similar syntax (<>= R code @), but
> > > there is anyway a lot of work to rewrite the R code to make a file
> > writes
> > > for Sweave working with odfWeave. A latex file can be convert to latex
> > or
> > > rtf, but it depends on external programs not very easy to use.
> > > For example, I would imagine an input similar to the syntax of help
> > files
> > > (.Rd), but the R code could be include (<< foo >>= R code @), and a
> >
> > When developing odfWeave, I did run into issues that could not be
> > taken into account with Sweave. That is why odfWeave calls Sweave
> > instead of using Sweave directly (as you would with the R2HTML
> > package). It would be nice to have a more uniform/expanded interface
> > in Sweave that can more naturally accommodate other types of markup
> > (beyond writing drivers).
> >
> > > Sweave-like function could replace R code with results and convert the
> > file
> > > into latex, html or odf.
> >
> > I *think* that odfWeave with OpenOffice/NeoOffice can do that. I think
> > I saw somewhere that newer versions of OO support LaTex, but clearly I
> > haven't looked into it. I do know that using OO as a conversion tool
> > to rtf, doc, pdf and html works very well.
> >
> > --
> >
> > Max
> >
>
> [[alternative HTML version deleted]]
>
>
> __
> R-help@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.
>

__
R-help@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.


Re: [R] odfWeave and xtable

2008-01-19 Thread Emmanuel Charpentier
宋时歌 a écrit :
> David,
> 
> The value of odfWeave is not limited to newbie users. It is vastly
> useful for researchers in fields that do not accept LaTeX for journal
> paper submission (for example, sociology, demography).

... and for those of us living in the salt mines of administration (in
my case), industry or economics|finance,, where damn Microsoft toolchain
is mandatory and anything else anathemous : we have to disguise our
outputs into something palatable to these tools, and odfWeave is a boon
to us ! Given one of Max's former mail addresses (pointing to a big
Pharma firm's mail server), I suspect that this was one of its
motivations. Thanks again, Max !

Thot is not to say that this tool cannot be perfected. I started to work
on cross-reference abilities but got interrupted bu some Real Live
nonmazskable interrupts, including some unplanned emergency works, the
loss of an USB key with my current work on this and some
non-unsignificant sickness...

Emmanuel Charpentier

__
R-help@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.


Re: [R] odfWeave learning resources

2008-12-17 Thread Max Kuhn
> In general I try not to post questions to forums until I've tried my best to
> read about them in the available documentation.  I recently undertook a
> project that used odfWeave and have been very pleased with the package.
> But, the R help documentation suggests that there are more sophisticated
> things I can do - for example, with conditionally formatted tables.

> Can anyone point me to resources I could review to educate myself about the
> full capabilities of this lovely package?

The package directory has a sub-directory called "examples" with a few
different odt files in it.

One is called "formatting.odt" and has examples for tables figures and
other things. See the end of the document for the code to use odfWeave
on it. If you would like to contribute example files, please let me
know.

-- 

Max

__
R-help@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.


[R] odfWeave: Error in matrixPaste(...)

2009-01-13 Thread Cleber Nogueira Borges


Hello all,
I try the follow test with an odf file.

*INPUT: teste.odt*
>=
x <- matrix(rnorm(6), nc=2)
xst <- tableStyles(x, useRowNames = TRUE, header = NULL)
odfTable(x, styles=xst,  colnames = NULL, useRowNames = TRUE)
@

and I get this error:

*OUTPUT error:*
Error:  chunk 1 (label=teste)

Error in matrixPaste(textStart, textName, textEnd, x, tagEnd, sep = 
rep("",  :

 all matrices must have the same dim

Any hint is welcome.
Thanks in advance

Cleber




More details

> odfWeave( 'teste.odt', 'out.odt')
 Copying  teste.odt
 Setting wd to  
C:\DOCUME~1\cborges\CONFIG~1\Temp\Rtmp1R0wvb/odfWeave13192909802

 Unzipping ODF file using unzip -o "teste.odt"
Archive:  teste.odt
extracting: mimetype   
  creating: Configurations2/statusbar/
 inflating: Configurations2/accelerator/current.xml 
  creating: Configurations2/floater/

  creating: Configurations2/popupmenu/
  creating: Configurations2/progressbar/
  creating: Configurations2/menubar/
  creating: Configurations2/toolbar/
  creating: Configurations2/images/Bitmaps/
 inflating: content.xml
 inflating: styles.xml 
extracting: meta.xml   
 inflating: Thumbnails/thumbnail.png 
 inflating: settings.xml   
 inflating: META-INF/manifest.xml  


 Removing  teste.odt
 Creating a Pictures directory

 Pre-processing the contents
 Sweaving  content.Rnw

 Writing to file content_1.xml
 Processing code chunks ...
   1 : echo term xml(label=teste)

Error:  chunk 1 (label=teste)
Error in matrixPaste(textStart, textName, textEnd, x, tagEnd, sep = 
rep("",  :

 all matrices must have the same dim
>
>
>
> xst <- tableStyles(x)
> xst
$table
[1] "RTable1"

$text
[,1][,2][,3]  
[1,] "ArialCentered" "ArialCentered" "ArialCentered"

[2,] "ArialCentered" "ArialCentered" "ArialCentered"
[3,] "ArialCentered" "ArialCentered" "ArialCentered"

$cell
[,1]   [,2]   [,3] 
[1,] "noBorder" "noBorder" "noBorder"

[2,] "noBorder" "noBorder" "noBorder"
[3,] "noBorder" "noBorder" "noBorder"

$header
NULL

$headerCell
NULL



> sessionInfo()
R version 2.8.1 (2008-12-22)
i386-pc-mingw32

locale:
LC_COLLATE=Portuguese_Brazil.1252;LC_CTYPE=Portuguese_Brazil.1252;LC_MONETARY=Portuguese_Brazil.1252;LC_NUMERIC=C;LC_TIME=Portuguese_Brazil.1252

attached base packages:
[1] stats graphics  grDevices utils datasets  methods   base


other attached packages:
[1] odfWeave_0.7.9  XML_1.99-0  lattice_0.17-20

loaded via a namespace (and not attached):
[1] grid_2.8.1  tools_2.8.1
>





___ 


Experimente já e veja as novidades.

__
R-help@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.


[R] odfweave sample code error

2009-02-04 Thread srinivasa raghavan
Hi R-team,


I am new user of R 2.8.1 in windows 2003 environment. I use Tinn-R as code
editor. When running the sample codes from odf manual the following error
occured.

I have winzip installed in my system. I used openoffice writer under windows
to create the example1.odt file.

can anybody help me out to fix the bug.

the code executed is as follows:

library(odfWeave)
> inFile <- "c:/example1.odt"
> outFile <- "c:/out.odt"
> imageDefs <- getImageDefs()
> imageDefs$dispWidth <- 4.5
> imageDefs$dispHeight<- 4.5
> setImageDefs(imageDefs)
>
> odfWeave(inFile, outFile)
  Copying  c:/example1.odt
  Setting wd to
C:\DOCUME~1\Srinivas\LOCALS~1\Temp\RtmpAgBGhm/odfWeave04172603473
  Unzipping ODF file using unzip -o "example1.odt"
Error in odfWeave(inFile, outFile) : Error unzipping file
In addition: Warning message:
In system(zipCmd[2], invisible = TRUE) : unzip not found


thanks in advance,

warm regards,
srinivas
statistical analyst.

[[alternative HTML version deleted]]

__
R-help@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.


[R] odfWeave examples not working

2008-03-12 Thread bartjoosen

Hi,

I'm currently taking a look at possibilities to report my results, produced
by R.
After looking at LaTex, I'm now considering the odf format, as most people
at my
company work with MS Word. So using odfWeave would be my best bet probably.

But if I run some examples from the odfWeave package, I cant open the output
in Open Office:

demoFile <- system.file("examples", "simple.odt", package = "odfWeave")
outputFile <- gsub("simple.odt", "output.odt", demoFile)
library(odfWeave)
odfWeave(demoFile, outputFile)

This will produce output.odt, which should be opened with OpenOfficeWriter I
think.

But if I run the code above, I get a warning message:
In strsplit(x, ".", extend = FALSE, fixed = TRUE) :
  argument 'extended = FALSE' will be ignored

If I open output.odt, I get a message box from open office to select a
filter used to open the file.
When I choose "open office 1.0 text document" I get: The file is damaged,
should Oo try to repair?
But after repair, I get a blank work sheet.


I'm working on windows XP, session info:
R version 2.6.2 (2008-02-08) 
i386-pc-mingw32 

locale:
LC_COLLATE=Dutch_Belgium.1252;LC_CTYPE=Dutch_Belgium.1252;LC_MONETARY=Dutch_Belgium.1252;LC_NUMERIC=C;LC_TIME=Dutch_Belgium.1252

attached base packages:
[1] grid  stats graphics  grDevices utils datasets  methods  
[8] base 

other attached packages:
[1] MASS_7.2-40odfWeave_0.7.3 XML_1.93-2.2   lattice_0.17-4

loaded via a namespace (and not attached):
[1] tools_2.6.2




Kind regards

Bart
-- 
View this message in context: 
http://www.nabble.com/odfWeave-examples-not-working-tp16000639p16000639.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@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.


[R] OdfWeave and contingency tables

2008-03-26 Thread Abhijit Dasgupta
Hi,

I would like to use odfWeave to output some contingency tables (the 
output of "table") into OOo. I know I can do this in LaTex (using 
"latex" in the Hmisc package), but I was wondering if it is possible in 
OdfWeave. My documentation to odfTable says inputs can only be vector, 
matrix or data.frame, and I'm having a hard time converting my table 
into one of these formats.

Regards
Abhijit

__
R-help@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.


[R] odfWeave: odt-file damaged

2009-07-06 Thread ukoenig

Dear all,
I am doing my first steps with odfWeave.

After running the r code (see below), I am trying to open the ODF-document
with open office, but I am getting the error message:

"The file is damaged, but it can be repaired". If I confirm the question and
repair the file with open office, I can open it with the desired output,
which seems to be fine.

My system:
   R Version 2.9.1
   Open Office 3.0.1
   7-Zip 4.65
   Windows XP

Using zip (http://www.info-zip.org/, zip232xN.zip) had the same result.

What causes the error message?  Is the structure of the ODF document
as it should be (for the structure please have a look at the bottom of  
this mail)?


I'd greatly appreciate any help.


Udo K o e n i g

Clinic for Child and Adolescent Psychiatry
Philipps University of Marburg, Germany


###
#R code
library(odfWeave)

#odfWeave call
odfWeave("c:/temp/odfWeave-test.odt", "c:/temp/odfWeave-test-out.odt",
 control=odfWeaveControl(zipCmd = c("7z a -tzip $$file$$ .",
 "7z e -tzip $$file$$")))

###
# Contents of my Open office document

<>=
#First steps with odfWeave
attach(iris)
@

There are \Sexpr{length(iris[, 1])} observations.

<>=
odfTable(iris[1:5,])
@

<>=
tab <- round(apply(iris[, 1:4], 2, mean), 2)
odfTable(tab, horizontal= TRUE)
@

<>=
boxplot(Sepal.Length~Species)
@

###
#Log


odfWeave("c:/temp/odfWeave-test.odt", "c:/temp/odfWeave-test-out.odt",

+  control=odfWeaveControl(zipCmd = c("7z a -tzip $$file$$ .",
+  "7z e -tzip $$file$$")))
  Copying  c:/temp/odfWeave-test.odt
  Setting wd to   
C:\DOCUME~1\Udo_2\LOCALS~1\Temp\Rtmp6QrXgk/odfWeave05190748330

  Unzipping ODF file using 7z e -tzip "odfWeave-test.odt"

7-Zip 4.65  Copyright (c) 1999-2009 Igor Pavlov  2009-02-03

Processing archive: odfWeave-test.odt

Extracting  mimetype
Extracting  Configurations2\statusbar
Extracting  Configurations2\accelerator\current.xml
Extracting  Configurations2\floater
Extracting  Configurations2\popupmenu
Extracting  Configurations2\progressbar
Extracting  Configurations2\menubar
Extracting  Configurations2\toolbar
Extracting  Configurations2\images\Bitmaps
Extracting  content.xml
Extracting  styles.xml
Extracting  meta.xml
Extracting  Thumbnails\thumbnail.png
Extracting  settings.xml
Extracting  META-INF\manifest.xml

Everything is Ok

Folders: 7
Files: 8
Size:   28518
Compressed: 8768

  Removing  odfWeave-test.odt
  Creating a Pictures directory

  Pre-processing the contents
  Sweaving  content.Rnw

  Writing to file content_1.xml
  Processing code chunks ...
1 : term hide(label=Initiate)
2 : term xml(label=Table)
3 : term xml(label=Table2)
4 : term verbatim(label=Boxplot)

  'content_1.xml' has been Sweaved

  Removing content.xml

  Post-processing the contents
  Removing content.Rnw
  Removing styles.xml
  Renaming styles_2.xml to styles.xml
  Removing extra files

  Packaging file using 7z a -tzip "odfWeave-test.odt" .

7-Zip 4.65  Copyright (c) 1999-2009 Igor Pavlov  2009-02-03
Scanning

Creating archive odfWeave-test.odt

Compressing  content.xml
Compressing  current.xml
Compressing  manifest.xml
Compressing  meta.xml
Compressing  mimetype
Compressing  Pictures\content_1-Boxplot.png
Compressing  settings.xml
Compressing  styles.xml
Compressing  thumbnail.png

Everything is Ok
  Copying  odfWeave-test.odt
  Resetting wd
  Removing  C:\DOCUME~1\Udo_2\LOCALS~1\Temp\Rtmp6QrXgk/odfWeave05190748330

  Done

###
#Structure of the unzipped odf-document that produced the error message

05.07.2009  11:43  Bitmaps
05.07.2009  19:0713.820 content.xml
05.07.2009  11:43 0 current.xml
05.07.2009  11:43  floater
05.07.2009  11:43 1.889 manifest.xml
05.07.2009  11:43  menubar
05.07.2009  11:43   968 meta.xml
05.07.2009  11:4339 mimetype
05.07.2009  22:18  Pictures
05.07.2009  11:43  popupmenu
05.07.2009  11:43  progressbar
05.07.2009  11:43 7.993 settings.xml
05.07.2009  11:43  statusbar
05.07.2009  19:0713.281 styles.xml
05.07.2009  11:43 1.579 thumbnail.png
05.07.2009  11:43  toolbar

__
R-help@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.


[R] odfWeave: odt-file damaged

2009-07-06 Thread ukoenig

Dear all,
I am doing my first steps with odfWeave.

After running the r code (see below), I am trying to open the ODF-document
with open office, but I am getting the error message:

"The file is damaged, but it can be repaired". If I confirm the question and
repair the file with open office, I can open it with the desired output,
which seems to be fine.

My system:
R Version 2.9.1
Open Office 3.0.1
7-Zip 4.65
Windows XP

Using zip (http://www.info-zip.org/, zip232xN.zip) had the same result.

What causes the error message?  Is the structure of the ODF document
as it should be (for the structure please have a look at the bottom of
this mail)?

I'd greatly appreciate any help.


Udo K o e n i g

Clinic for Child and Adolescent Psychiatry
Philipps University of Marburg, Germany


###
#R code
library(odfWeave)

#odfWeave call
odfWeave("c:/temp/odfWeave-test.odt", "c:/temp/odfWeave-test-out.odt",
  control=odfWeaveControl(zipCmd = c("7z a -tzip $$file$$ .",
  "7z e -tzip $$file$$")))

###
# Contents of my Open office document

<>=
#First steps with odfWeave
attach(iris)
@

There are \Sexpr{length(iris[, 1])} observations.

<>=
odfTable(iris[1:5,])
@

<>=
tab <- round(apply(iris[, 1:4], 2, mean), 2)
odfTable(tab, horizontal= TRUE)
@

<>=
boxplot(Sepal.Length~Species)
@

###
#Log


odfWeave("c:/temp/odfWeave-test.odt", "c:/temp/odfWeave-test-out.odt",

+  control=odfWeaveControl(zipCmd = c("7z a -tzip $$file$$ .",
+  "7z e -tzip $$file$$")))
   Copying  c:/temp/odfWeave-test.odt
   Setting wd to
C:\DOCUME~1\Udo_2\LOCALS~1\Temp\Rtmp6QrXgk/odfWeave05190748330
   Unzipping ODF file using 7z e -tzip "odfWeave-test.odt"

7-Zip 4.65  Copyright (c) 1999-2009 Igor Pavlov  2009-02-03

Processing archive: odfWeave-test.odt

Extracting  mimetype
Extracting  Configurations2\statusbar
Extracting  Configurations2\accelerator\current.xml
Extracting  Configurations2\floater
Extracting  Configurations2\popupmenu
Extracting  Configurations2\progressbar
Extracting  Configurations2\menubar
Extracting  Configurations2\toolbar
Extracting  Configurations2\images\Bitmaps
Extracting  content.xml
Extracting  styles.xml
Extracting  meta.xml
Extracting  Thumbnails\thumbnail.png
Extracting  settings.xml
Extracting  META-INF\manifest.xml

Everything is Ok

Folders: 7
Files: 8
Size:   28518
Compressed: 8768

   Removing  odfWeave-test.odt
   Creating a Pictures directory

   Pre-processing the contents
   Sweaving  content.Rnw

   Writing to file content_1.xml
   Processing code chunks ...
 1 : term hide(label=Initiate)
 2 : term xml(label=Table)
 3 : term xml(label=Table2)
 4 : term verbatim(label=Boxplot)

   'content_1.xml' has been Sweaved

   Removing content.xml

   Post-processing the contents
   Removing content.Rnw
   Removing styles.xml
   Renaming styles_2.xml to styles.xml
   Removing extra files

   Packaging file using 7z a -tzip "odfWeave-test.odt" .

7-Zip 4.65  Copyright (c) 1999-2009 Igor Pavlov  2009-02-03
Scanning

Creating archive odfWeave-test.odt

Compressing  content.xml
Compressing  current.xml
Compressing  manifest.xml
Compressing  meta.xml
Compressing  mimetype
Compressing  Pictures\content_1-Boxplot.png
Compressing  settings.xml
Compressing  styles.xml
Compressing  thumbnail.png

Everything is Ok
   Copying  odfWeave-test.odt
   Resetting wd
   Removing  C:\DOCUME~1\Udo_2\LOCALS~1\Temp\Rtmp6QrXgk/odfWeave05190748330

   Done

###
#Structure of the unzipped odf-document that produced the error message

05.07.2009  11:43  Bitmaps
05.07.2009  19:0713.820 content.xml
05.07.2009  11:43 0 current.xml
05.07.2009  11:43  floater
05.07.2009  11:43 1.889 manifest.xml
05.07.2009  11:43  menubar
05.07.2009  11:43   968 meta.xml
05.07.2009  11:4339 mimetype
05.07.2009  22:18  Pictures
05.07.2009  11:43  popupmenu
05.07.2009  11:43  progressbar
05.07.2009  11:43 7.993 settings.xml
05.07.2009  11:43  statusbar
05.07.2009  19:0713.281 styles.xml
05.07.2009  11:43 1.579 thumbnail.png
05.07.2009  11:43  toolbar

__
R-help@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.


Re: [R] odfWeave problem in 7.1?

2008-07-10 Thread Jim Porzak
I just noticed that CRAN Package check Error for Windows & Mac:
http://www.r-project.org/nosvn/R.check/r-patched-windows-x86_64/odfWeave-00check.html

-Jim


On Thu, Jul 10, 2008 at 3:03 PM, Jim Porzak <[EMAIL PROTECTED]> wrote:
> Max & Friends,
>
> I've run into a problem with odfWeave 0.7.5 running under R 2.7.1
> (Windows XP, SP2) doing some monthly production reports.
>
> Under 2.7.1 I'm getting various parsing errors after Sweaving starts, e.g.:
>
>  Sweaving  content.Rnw
>
>  Writing to file content_1.xml
>  Processing code chunks ...
> Error in parse(text = cmd) : unexpected input in " "
>>
>
> Above case works fine under 2.6.2:
>
>  Sweaving  content.Rnw
>
>  Writing to file content_1.xml
>  Processing code chunks ...
>1 : term xml(label=MissingTable)
>2 : term xml(label=UnusualTable)
>3 : term verbatim(label=MembCounts)
>4 : term verbatim(label=UsageCounts)
>5 : term verbatim(label=SessionsCounts)
>6 : term verbatim(label=SR_MembershipCounts)
>7 : term verbatim(label=MiscCounts)
>
>  'content_1.xml' has been Sweaved
>
>  Removing content.xml
>
>  Post-processing the contents
>  Removing content.Rnw
>  Removing styles.xml
>  Renaming styles_2.xml to styles.xml
>  Removing extra files
>
>  Packaging file using zip -r "24HF_MonthlyLoadQA20Counts_Source.odt" .
>  Copying  24HF_MonthlyLoadQA20Counts_Source.odt
>  Resetting wd
>  Removing  C:/Data/24HF_QA/R/DocsPlots/Work
>
>  Done
>>
>
> Any ideas?
>
> TIA,
> Jim Porzak
> Responsys, Inc.
> San Francisco, CA
> http://www.linkedin.com/in/jimporzak
>

__
R-help@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.


Re: [R] odfWeave problem in 7.1?

2008-07-10 Thread Dieter Menne
Jim Porzak  gmail.com> writes:

> 
> I just noticed that CRAN Package check Error for Windows & Mac:
>
http://www.r-project.org/nosvn/R.check/r-patched-windows-x86_64/odfWeave-00check.html
> 
> >
> > I've run into a problem with odfWeave 0.7.5 running under R 2.7.1
> > (Windows XP, SP2) doing some monthly production reports.
> >
> > Under 2.7.1 I'm getting various parsing errors after Sweaving starts, e.g.:
> >

You might try to download an older version of XML to handle that; we had a
similar problem with special characters, i.e. umlauts:

>>odfWeave and umlauts work with XML 1.9.0, but not with XML 1.95.2

Max Kuhn,  Duncan Murdoch and Nathan Coulter are aware of the problem.

Dieter

__
R-help@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.


Re: [R] odfWeave problem in 7.1?

2008-07-11 Thread Jim Porzak
Dieter,

Thanks for tip. Well, XML 1.93-2.2 is what's working for me in my
2.6.2 environment:

R2.6.2 environment has XML Version: 1.93-2.2
R2.7.1 environment has XML Version: 1.95-3

Max, I'll try rolling back the XML package in my 2.7.1 environment
this weekend to see if that makes a difference.

-Jim


On Thu, Jul 10, 2008 at 11:35 PM, Dieter Menne
<[EMAIL PROTECTED]> wrote:
> Jim Porzak  gmail.com> writes:
>
>>
>> I just noticed that CRAN Package check Error for Windows & Mac:
>>
> http://www.r-project.org/nosvn/R.check/r-patched-windows-x86_64/odfWeave-00check.html
>>
>> >
>> > I've run into a problem with odfWeave 0.7.5 running under R 2.7.1
>> > (Windows XP, SP2) doing some monthly production reports.
>> >
>> > Under 2.7.1 I'm getting various parsing errors after Sweaving starts, e.g.:
>> >
>
> You might try to download an older version of XML to handle that; we had a
> similar problem with special characters, i.e. umlauts:
>
>>>odfWeave and umlauts work with XML 1.9.0, but not with XML 1.95.2
>
> Max Kuhn,  Duncan Murdoch and Nathan Coulter are aware of the problem.
>
> Dieter
>
> __
> R-help@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.
>

__
R-help@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.


Re: [R] odfWeave problem in 7.1?

2008-07-12 Thread Prof Brian Ripley

On Fri, 11 Jul 2008, Dieter Menne wrote:
y

Jim Porzak  gmail.com> writes:



I just noticed that CRAN Package check Error for Windows & Mac:


http://www.r-project.org/nosvn/R.check/r-patched-windows-x86_64/odfWeave-00check.html




I've run into a problem with odfWeave 0.7.5 running under R 2.7.1
(Windows XP, SP2) doing some monthly production reports.

Under 2.7.1 I'm getting various parsing errors after Sweaving starts, e.g.:



You might try to download an older version of XML to handle that; we had a
similar problem with special characters, i.e. umlauts:


odfWeave and umlauts work with XML 1.9.0, but not with XML 1.95.2


Max Kuhn,  Duncan Murdoch and Nathan Coulter are aware of the problem.


There is a Windows version of XML_1.93-2.3.zip available on my repository 
to help people work around this long-standing (and oft reported) bug in 
odfWeave.  You can access it directly by


http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/2.7/XML_1.93-2.3.zip

Recent versions of odfWeave/XML only work correctly in UTF-8 locales and 
hence not on Windows.


--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
R-help@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.


Re: [R] odfWeave problem in 7.1?

2008-09-03 Thread Jim Porzak
Brian,

A VERY belated thank you for your patch to XML package!

It does, as expected, fix problems I was having.

Best,
Jim Porzak
Responsys, Inc.
San Francisco, CA
http://www.linkedin.com/in/jimporzak
useR Group SF: http://ia.meetup.com/67/



On Sat, Jul 12, 2008 at 10:39 AM, Prof Brian Ripley
<[EMAIL PROTECTED]> wrote:
> On Fri, 11 Jul 2008, Dieter Menne wrote:
> y
>>
>> Jim Porzak  gmail.com> writes:
>>
>>>
>>> I just noticed that CRAN Package check Error for Windows & Mac:
>>>
>>
>> http://www.r-project.org/nosvn/R.check/r-patched-windows-x86_64/odfWeave-00check.html
>>>

 I've run into a problem with odfWeave 0.7.5 running under R 2.7.1
 (Windows XP, SP2) doing some monthly production reports.

 Under 2.7.1 I'm getting various parsing errors after Sweaving starts,
 e.g.:

>>
>> You might try to download an older version of XML to handle that; we had a
>> similar problem with special characters, i.e. umlauts:
>>
 odfWeave and umlauts work with XML 1.9.0, but not with XML 1.95.2
>>
>> Max Kuhn,  Duncan Murdoch and Nathan Coulter are aware of the problem.
>
> There is a Windows version of XML_1.93-2.3.zip available on my repository to
> help people work around this long-standing (and oft reported) bug in
> odfWeave.  You can access it directly by
>
> http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/2.7/XML_1.93-2.3.zip
>
> Recent versions of odfWeave/XML only work correctly in UTF-8 locales and
> hence not on Windows.
>
> --
> Brian D. Ripley,  [EMAIL PROTECTED]
> Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
> University of Oxford, Tel:  +44 1865 272861 (self)
> 1 South Parks Road, +44 1865 272866 (PA)
> Oxford OX1 3TG, UKFax:  +44 1865 272595
>
> __
> R-help@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.
>

__
R-help@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.


Re: [R] odfWeave: Error in matrixPaste(...)

2009-01-13 Thread Max Kuhn
> Hello all,
> I try the follow test with an odf file.
>
> *INPUT: teste.odt*
> >=
> x <- matrix(rnorm(6), nc=2)
> xst <- tableStyles(x, useRowNames = TRUE, header = NULL)
> odfTable(x, styles=xst,  colnames = NULL, useRowNames = TRUE)
> @

Here is one issue: you are asking for the row names to be styled and
printed but your matrix has no row names. tableStyles creates a 3x3
matrix of styles but, when run through format, your matrix is 3x2.

However, there is an unrelated bug that this exposed since you are
using header = NULL. I'll need to fix that. A temporary work-around is
to get a blank header line via

   x <- matrix(rnorm(6), nc=2)
   rownames(x) <- letters[1:3] # create row names or have useRowNames = FALSE
   colnames(x) <- rep("", ncol(x))
   xst <- tableStyles(x, useRowNames = TRUE, header = NULL)
   odfTable(x, styles=xst,  colnames = NULL, useRowNames = TRUE)

or, since your data have no row names

   x <- matrix(rnorm(6), nc=2)
   xst <- tableStyles(x, useRowNames = FALSE, header = NULL)
   odfTable(x, styles=xst,  colnames = NULL, useRowNames = FALSE)

I'll be working on odfWeave Monday, so I'll try to get a fix out then.

Max

__
R-help@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.


Re: [R] odfweave sample code error

2009-02-04 Thread Michael Bibo
srinivasa raghavan  gmail.com> writes:

> I have winzip installed in my system.



> Error in odfWeave(inFile, outFile) : Error unzipping file
> In addition: Warning message:
> In system(zipCmd[2], invisible = TRUE) : unzip not found
> 
> thanks in advance,
> 
> warm regards,
> srinivas
> statistical analyst.
> 

I have solved this problem by downloading the zip utilities from the site
referenced on the odfWeave help page, and making sure they are placed in a
directory which is included in the system path.  It even works with portable
openoffice.

You may be able to get winzip working with odfWeave through odfWeaveControl(),
but I haven't tried this myself.  See:
http://finzi.psych.upenn.edu/R/Rhelp02/archive/118223.html

Hope this helps,

Michael Bibo
Queensland Health

__
R-help@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.


Re: [R] OdfWeave and contingency tables

2008-03-26 Thread Greg Snow
I believe that work is in progress to make odfTable work on tables as
well, in the meantime if you use "unclass" on a table you get back a
matrix that works with odfTable.

Hope this helps,

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
[EMAIL PROTECTED]
(801) 408-8111
 
 

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Abhijit Dasgupta
> Sent: Wednesday, March 26, 2008 10:28 AM
> To: r-help@r-project.org
> Subject: [R] OdfWeave and contingency tables
> 
> Hi,
> 
> I would like to use odfWeave to output some contingency 
> tables (the output of "table") into OOo. I know I can do this 
> in LaTex (using "latex" in the Hmisc package), but I was 
> wondering if it is possible in OdfWeave. My documentation to 
> odfTable says inputs can only be vector, matrix or 
> data.frame, and I'm having a hard time converting my table 
> into one of these formats.
> 
> Regards
> Abhijit
> 
> __
> R-help@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.
> 

__
R-help@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.


[R] odfWeave problem "Error in xmlEventParse"

2009-02-24 Thread Fredrik Karlsson
Dear list,

Sorry for bothering you with a pure odfSweave question, but I just ran
into a problem that I cannot find the cause of.
Anyonse seen this before? This file "used to work", but not anymore.

Would apreciate all the help I could get.

/Fredrik


---

> odfWeave("Descriptives/IPDesc.odt","IPDescOut.odt")
  Copying  Descriptives/IPDesc.odt
  Setting wd to
/var/folders/IV/IVKgtoUIF3CjOMG8RfyjoTU/-Tmp-//RtmpPbfKbO/odfWeave24150415398
  Unzipping ODF file using unzip -o IPDesc.odt
Archive:  IPDesc.odt

  Removing  IPDesc.odt
  Creating a Pictures directory

  Pre-processing the contents
 extracting: mimetype
   creating: Configurations2/statusbar/
  inflating: Configurations2/accelerator/current.xml
   creating: Configurations2/floater/
   creating: Configurations2/popupmenu/
   creating: Configurations2/progressbar/
   creating: Configurations2/menubar/
   creating: Configurations2/toolbar/
   creating: Configurations2/images/Bitmaps/
  inflating: layout-cache
  inflating: content.xml
  inflating: styles.xml
 extracting: meta.xml
  inflating: Thumbnails/thumbnail.png
  inflating: settings.xml
  inflating: META-INF/manifest.xml
  Sweaving  content.Rnw

  Writing to file content_1.xml
  Processing code chunks ...
1 : term verbatim(label=Init)
2 : term xml(label=IPTransSummary_SL)
3 : term xml(label=IPTransSummary_SP)
4 : term xml(label=IPTransSummary_SL_CY)
5 : term xml(label=IPTransSummary_SP_CY)
6 : term xml(label=IPTransSummary_SP_CY_SE)
7 : term xml(label=IPTransSummary_SL_IPL)
8 : term xml(label=IPTransSummary_SP_IPL)
9 : term xml(label=IP_CY_SL_mean)
   10 : term xml(label=IP_CY_SL_sd)
   11 : term verbatim(label=IPLenWords_CY_SL_bwplot)
   12 : term verbatim(label=IPLenWords_SL_CY_bwplot)
   13 : term xml(label=IP_CY_SP_mean)
   14 : term xml(label=IP_CY_SP_sd)
   15 : term verbatim(label=IPLenWords_CY_SP_bwplot)
   16 : term verbatim(label=IPLenWords_SP_CY_bwplot)
   17 : term xml(label=IP_CY_SL_mean)
   18 : term xml(label=IP_CY_SL_sd)
   19 : term verbatim(label=IPLenSylls_CY_SL_bwplot)
   20 : term verbatim(label=IPLenSylls_SL_CY_bwplot)
   21 : term xml(label=IP_CY_SP_mean)
   22 : term xml(label=IP_CY_SP_sd)
   23 : term verbatim(label=IPLenSylls_CY_SP_bwplot)
   24 : term verbatim(label=IPLenSylls_SP_CY_bwplot)
   25 : term verbatim(label=IplenCalc)
   26 : term xml(label=WordLenSyll_CY_SL_mean)
   27 : term xml(label=WordLenSyll_CY_SL_sd)
   28 : term verbatim(label=WordLenSyll_CY_SL_bwplot)
   29 : term verbatim(label=WordLenSyll_SL_CY_bwplot)
   30 : term xml(label=WordLenSyll_CY_SP_mean)
   31 : term xml(label=WordLenSyll_CY_SP_sd)
   32 : term verbatim(label=WordLenSyll_CY_SP_bwplot)
   33 : term verbatim(label=WordLenSyll_SP_CY_bwplot)
   34 : term verbatim(label=CleanTA)
   35 : term xml(label=IP_PA_CY_SL_mean)
   36 : term xml(label=IP_PA_CY_SL_sd)
   37 : term verbatim(label=IPLenTones_CY_SL_bwplot)
   38 : term verbatim(label=IPLenTones_SL_CY_bwplot)
   39 : term xml(label=IP_PA_CY_SP_mean)
   40 : term xml(label=IP_PA_CY_SP_sd)
   41 : term verbatim(label=IPLenTones_CY_SP_bwplot)
   42 : term verbatim(label=IPLenTones_SP_CY_bwplot)
   43 : term verbatim(label=IPClassrm)
   44 : term verbatim(label=IPClassDistRelRM_PA_SL_CY_Fig)
   45 : term verbatim(label=IPClassDistRelRM_PA_CY_SL_Fig)
   46 : term verbatim(label=IPClassDistRelRM_PA_CY_SP_Fig)
   47 : term xml(label=IPTrans_TS_SL_count)
   48 :(label=IPTrans_TS_SP_count)
   49 : term verbatim(label=close)

  'content_1.xml' has been Sweaved

  Removing content.xml

  Post-processing the contents
Error in xmlEventParse(infile, handlers = handlers, trim = FALSE,
state = state) :
  attempt to apply non-function
In addition: Warning message:
closing unused connection 3 (content.xml)
>

---



-- 
"Life is like a trumpet - if you don't put anything into it, you don't
get anything out of it."

__
R-help@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.


Re: [R] odfWeave: odt-file damaged

2009-07-07 Thread ukoenig

Hi,
I think, I can answer my own posting. I found out, that the directory  
structure

of the ODT-file created by "odfWeave" causes the error message.

The file structure of the unzipped odt-file looks like this:

 Pictures
  content_1-Boxplot.png
content.xml
current.xml
manifest.xml
meta.xml
mimetype
settings.xml
styles.xml
thumbnail.png


But it should look like this:

 META-INF
  manifest.xml
 Thumbnails
  thumbnail.png
 Pictures
  content_1-Boxplot.png
meta.xml
mimetype
settings.xml
styles.xml
content.xml

Now I know. what causes the message "odt file damaged",
but I don´t know a solution. Does anyone do so?

Thanks, Udo





Dear all,
I am doing my first steps with odfWeave.

After running the r code (see below), I am trying to open the ODF-document
with open office, but I am getting the error message:

"The file is damaged, but it can be repaired". If I confirm the question and
repair the file with open office, I can open it with the desired output,
which seems to be fine.

My system:
R Version 2.9.1
Open Office 3.0.1
7-Zip 4.65
Windows XP

Using zip (http://www.info-zip.org/, zip232xN.zip) had the same result.

What causes the error message?  Is the structure of the ODF document
as it should be (for the structure please have a look at the bottom of
this mail)?

I'd greatly appreciate any help.


Udo K o e n i g

Clinic for Child and Adolescent Psychiatry
Philipps University of Marburg, Germany


###
#R code
library(odfWeave)

#odfWeave call
odfWeave("c:/temp/odfWeave-test.odt", "c:/temp/odfWeave-test-out.odt",
  control=odfWeaveControl(zipCmd = c("7z a -tzip $$file$$ .",
  "7z e -tzip $$file$$")))

###
# Contents of my Open office document

<>=
#First steps with odfWeave
attach(iris)
@

There are \Sexpr{length(iris[, 1])} observations.

<>=
odfTable(iris[1:5,])
@

<>=
tab <- round(apply(iris[, 1:4], 2, mean), 2)
odfTable(tab, horizontal= TRUE)
@

<>=
boxplot(Sepal.Length~Species)
@

###
#Log


odfWeave("c:/temp/odfWeave-test.odt", "c:/temp/odfWeave-test-out.odt",

+  control=odfWeaveControl(zipCmd = c("7z a -tzip $$file$$ .",
+  "7z e -tzip $$file$$")))
   Copying  c:/temp/odfWeave-test.odt
   Setting wd to
C:\DOCUME~1\Udo_2\LOCALS~1\Temp\Rtmp6QrXgk/odfWeave05190748330
   Unzipping ODF file using 7z e -tzip "odfWeave-test.odt"

7-Zip 4.65  Copyright (c) 1999-2009 Igor Pavlov  2009-02-03

Processing archive: odfWeave-test.odt

Extracting  mimetype
Extracting  Configurations2\statusbar
Extracting  Configurations2\accelerator\current.xml
Extracting  Configurations2\floater
Extracting  Configurations2\popupmenu
Extracting  Configurations2\progressbar
Extracting  Configurations2\menubar
Extracting  Configurations2\toolbar
Extracting  Configurations2\images\Bitmaps
Extracting  content.xml
Extracting  styles.xml
Extracting  meta.xml
Extracting  Thumbnails\thumbnail.png
Extracting  settings.xml
Extracting  META-INF\manifest.xml

Everything is Ok

Folders: 7
Files: 8
Size:   28518
Compressed: 8768

   Removing  odfWeave-test.odt
   Creating a Pictures directory

   Pre-processing the contents
   Sweaving  content.Rnw

   Writing to file content_1.xml
   Processing code chunks ...
 1 : term hide(label=Initiate)
 2 : term xml(label=Table)
 3 : term xml(label=Table2)
 4 : term verbatim(label=Boxplot)

   'content_1.xml' has been Sweaved

   Removing content.xml

   Post-processing the contents
   Removing content.Rnw
   Removing styles.xml
   Renaming styles_2.xml to styles.xml
   Removing extra files

   Packaging file using 7z a -tzip "odfWeave-test.odt" .

7-Zip 4.65  Copyright (c) 1999-2009 Igor Pavlov  2009-02-03
Scanning

Creating archive odfWeave-test.odt

Compressing  content.xml
Compressing  current.xml
Compressing  manifest.xml
Compressing  meta.xml
Compressing  mimetype
Compressing  Pictures\content_1-Boxplot.png
Compressing  settings.xml
Compressing  styles.xml
Compressing  thumbnail.png

Everything is Ok
   Copying  odfWeave-test.odt
   Resetting wd
   Removing  C:\DOCUME~1\Udo_2\LOCALS~1\Temp\Rtmp6QrXgk/odfWeave05190748330

   Done

###
#Structure of the unzipped odf-document that produced the error message

05.07.2009  11:43  Bitmaps
05.07.2009  19:0713.820 content.xml
05.07.2009  11:43 0 current.xml
05.07.2009  11:43  floater
05.07.2009  11:43 1.889 manifest.xml
05.07.2009  11:43  menubar
05.07.2009  11:43   968 meta.xml
05.07.2009  11:4339 mimetype
05.07.2009  22:18  Pictures
05.07.2009  11:43  popupmenu
05.07.2009  11:43  progressbar
05.07.2009  11:43 7.993 settings.xml
05.07.2009  11:43   

[R] odfWeave : sudden and unexplained error

2009-08-01 Thread Emmanuel Charpentier
Dear list, dear Max,

I a currently working on a report. I'm writing it with OpenOffice.org
and odfWeave. I'm working increentally : I write a bit, test
(interactively) some ideas, cutting-and-pasting code to the Ooo report
when satisfied with it. I the process, I tend to recompile the .odt
source a *lot*.

Suddenly, odfWeave started to give me an incomprehensible error even
before starting the compilation itself (InFile is my inut .odt file,
Outfile is the resultant .odt file) :

> odfWeave(InFile, OutFile)
  Copying  SrcAnalyse1.odt 
  Setting wd to  /tmp/RtmphCUkSf/odfWeave01225949667 
  Unzipping ODF file using unzip -o SrcAnalyse1.odt 
Archive:  SrcAnalyse1.odt
 extracting: mimetype
  inflating: content.xml 
  inflating: layout-cache
  inflating: styles.xml  
 extracting: meta.xml
  inflating: Thumbnails/thumbnail.png  
  inflating: Configurations2/accelerator/current.xml  
   creating: Configurations2/progressbar/
   creating: Configurations2/floater/
   creating: Configurations2/popupmenu/
   creating: Configurations2/menubar/
   creating: Configurations2/toolbar/
   creating: Configurations2/images/Bitmaps/
   creating: Configurations2/statusbar/
  inflating: settings.xml
  inflating: META-INF/manifest.xml   

  Removing  SrcAnalyse1.odt 
  Creating a Pictures directory

  Pre-processing the contents
Erreur : cc$parentId == parentId is not TRUE
> 
Perusing the documentation and the r-help list archives didn't turn up
anything relevant. This error survived restarting OOo, restarting R,
restarting its enclosing Emacs session and even rebooting the damn
hardware...

Any idea ?

Emmanuel Charpentier

__
R-help@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.


[R] odfWeave and XML... on a Mac

2008-11-26 Thread Tubin

I'm trying out odfWeave in a Mac environment and getting some odd behavior.
Having figured out that the code snippets only work if they're in certain
fonts, I was able to get R to run a test document through and produce an
output document.  After running it, though, I get a warning message: 

Warning message:
In file.remove("styles_2.xml") :
  cannot remove file 'styles_2.xml', reason 'No such file or directory'

This message is interesting given that about 20 lines earlier I see:
Renaming styles_2.xml to styles.xml

If I run the test doc in results=verbatim mode, I see that warning by my
results appear in the appropriate places on the output document:

*output*
This is the basic text stuff.  Now I will try to input the other stuff:

[1] 5

And this is the after-text. 
*end*

If I run the test document in results=xml mode, though, the output is blank:

***output*

This is the basic text stuff.  Now I will try to input the other stuff:


And this is the after-text.
**end*

Earlier posts on this forum suggest that the solution may involve loading an
earlier build of XML.  Is that likely to work?  And if so - stupid question
I'm sure, but how do I do that?

Thanks in advance for the time and attention of people more experienced than
myself...


-- 
View this message in context: 
http://www.nabble.com/odfWeave-and-XML...-on-a-Mac-tp20702670p20702670.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@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.


Re: [R] odfWeave problem "Error in xmlEventParse"

2009-02-24 Thread Dieter Menne
Fredrik Karlsson  gmail.com> writes:

> 
> Dear list,
> 
> Sorry for bothering you with a pure odfSweave question, but I just ran
> into a problem that I cannot find the cause of.
> Anyonse seen this before? This file "used to work", but not anymore.
> 
> Would apreciate all the help I could get.
> 


If this is Windows: 

http://markmail.org/message/qsrqdtozizlngbrt


We should make this an FAQ (or find someone who knows how to correct the bug in
XML).

Dieter

__
R-help@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.


Re: [R] odfWeave problem "Error in xmlEventParse"

2009-02-25 Thread Max Kuhn
> We should make this an FAQ (or find someone who knows how to correct the bug 
> in
> XML).

We've been working on that.

It's hard to say what the problem is without the output of
sessionInfo() and a reproducible example.

Fredrik - if you can send me this off-list, I'll take a look (but it
may take me a few days to get to it).

-- 

Max

__
R-help@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.


[R] odfWeave : problems with odfInsertPlot() and odfFigureCaption()

2009-06-30 Thread Emmanuel Charpentier
Dear Max, dear list,

I have trouble using odfInsertPlot to insert plots outside fig=TRUE
chunks.

My goal is to dump a bunch of (relatively uninteresting, but required)
graphs from within a loop, possibly interspeded with some tables. This
is not possible within a normal fig=TRUE chunk.

odfInsertPlot() is able to insert a previously saved plot. When used in
a fig=TRUE, results=hide chunk, it produces just a blank frame (with a
caption if caption=odfFigureCaption() is used).

Used in a fig=TRUE, results=xml chunk, it produces an error at file
rte-assembly (see end of post). However, when wrapped in a cat(), the
same code produces 1) the figure (without caption), then a blank frame
with the caption, or just the figure (without caption) if the caption=()
argument is absent.

The same cat(odfInsertPlot()) construct can be used in a results=xml
chunk (no fig=TRUE) ; however, I found no way to insert the caption.

Therefore : I can programmatically create graphs and insert them via
results=xml chunks, but I can't caption them.

Do someone has a workaround (except reprogramming odfFigureCaption()
with a new argument taking the output of odfInsertPlot()) ?

Sincerely,

Emmanuel Charpentier

Annex : log of compilation with fig=true, results=xml.
> odfWeave("Test1Src.odt", "Test1.odt")
  Copying  Test1Src.odt 
  Setting wd to  /tmp/RtmpenMTgz/odfWeave3023572231 
  Unzipping ODF file using unzip -o Test1Src.odt 
Archive:  Test1Src.odt
 extracting: mimetype
  inflating: content.xml 
  inflating: layout-cache
  inflating: styles.xml  
 extracting: meta.xml
  inflating: Thumbnails/thumbnail.png  
  inflating: Configurations2/accelerator/current.xml  
   creating: Configurations2/progressbar/
   creating: Configurations2/floater/
   creating: Configurations2/popupmenu/
   creating: Configurations2/menubar/
   creating: Configurations2/toolbar/
   creating: Configurations2/images/Bitmaps/
   creating: Configurations2/statusbar/
  inflating: settings.xml
  inflating: META-INF/manifest.xml   

  Removing  Test1Src.odt 
  Creating a Pictures directory

  Pre-processing the contents
  Sweaving  content.Rnw 

  Writing to file content_1.xml
  Processing code chunks ...
1 : term hide(label=ProlégomènesStandard)
2 : term xml(label=EssaiGraphe1)
3 : echo term verbatim(label=TestChunk)
4 : term xml(label=SecondChunk)

  'content_1.xml' has been Sweaved

  Removing content.xml

  Post-processing the contents
error parsing attribute name
attributes construct error
xmlParseStartTag: problem parsing attributes
Couldn't find end of Start Tag draw:frame line 6
error parsing attribute name
attributes construct error
xmlParseStartTag: problem parsing attributes
Couldn't find end of Start Tag draw:image line 6
Opening and ending tag mismatch: text:p line 6 and draw:frame
Opening and ending tag mismatch: office:text line 2 and text:p
Opening and ending tag mismatch: office:body line 2 and office:text
Opening and ending tag mismatch: office:document-content line 2 and
office:body
Extra content at the end of the document
Erreur : 1: error parsing attribute name
2: attributes construct error
3: xmlParseStartTag: problem parsing attributes
4: Couldn't find end of Start Tag draw:frame line 6
5: error parsing attribute name
6: attributes construct error
7: xmlParseStartTag: problem parsing attributes
8: Couldn't find end of Start Tag draw:image line 6
9: Opening and ending tag mismatch: text:p line 6 and draw:frame
10: Opening and ending tag mismatch: office:text line 2 and text:p
11: Opening and ending tag mismatch: office:body line 2 and office:text
12: Opening and ending tag mismatch: office:document-content line 2 and
office:body
13: Extra content at the end of the document
>

__
R-help@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.


Re: [R] odfWeave : sudden and unexplained error

2009-08-01 Thread Max Kuhn
Sending me a reproducible example and the results of sessionInfo() would help.

Max

On Sat, Aug 1, 2009 at 5:13 PM, Emmanuel
Charpentier wrote:
> Dear list, dear Max,
>
> I a currently working on a report. I'm writing it with OpenOffice.org
> and odfWeave. I'm working increentally : I write a bit, test
> (interactively) some ideas, cutting-and-pasting code to the Ooo report
> when satisfied with it. I the process, I tend to recompile the .odt
> source a *lot*.
>
> Suddenly, odfWeave started to give me an incomprehensible error even
> before starting the compilation itself (InFile is my inut .odt file,
> Outfile is the resultant .odt file) :
>
>> odfWeave(InFile, OutFile)
>  Copying  SrcAnalyse1.odt
>  Setting wd to  /tmp/RtmphCUkSf/odfWeave01225949667
>  Unzipping ODF file using unzip -o SrcAnalyse1.odt
> Archive:  SrcAnalyse1.odt
>  extracting: mimetype
>  inflating: content.xml
>  inflating: layout-cache
>  inflating: styles.xml
>  extracting: meta.xml
>  inflating: Thumbnails/thumbnail.png
>  inflating: Configurations2/accelerator/current.xml
>   creating: Configurations2/progressbar/
>   creating: Configurations2/floater/
>   creating: Configurations2/popupmenu/
>   creating: Configurations2/menubar/
>   creating: Configurations2/toolbar/
>   creating: Configurations2/images/Bitmaps/
>   creating: Configurations2/statusbar/
>  inflating: settings.xml
>  inflating: META-INF/manifest.xml
>
>  Removing  SrcAnalyse1.odt
>  Creating a Pictures directory
>
>  Pre-processing the contents
> Erreur : cc$parentId == parentId is not TRUE
>>
> Perusing the documentation and the r-help list archives didn't turn up
> anything relevant. This error survived restarting OOo, restarting R,
> restarting its enclosing Emacs session and even rebooting the damn
> hardware...
>
> Any idea ?
>
>                                        Emmanuel Charpentier
>
> __
> R-help@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.
>



-- 

Max

__
R-help@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.


Re: [R] odfWeave and XML... on a Mac

2008-12-01 Thread Max Kuhn
In case anyone has a similar issue, this problem was related to how
the results were being sent to the file.

The offending code chunk used:

<>=
x<- 5
x
@

which writes out the text "5" without any XML around it. When OO opens
the document up, it ignores this text (instead of crashing) and shows
nothing.

This works fine:

<>=
x<- 5
odfCat(x)
@

__
R-help@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.


Re: [R] odfWeave : problems with odfInsertPlot() and odfFigureCaption()

2009-06-30 Thread Max Kuhn
Well, on this one, I might bring my record down to commercial software
bug fix time lines...

> I have trouble using odfInsertPlot to insert plots outside fig=TRUE
> chunks.
>
> My goal is to dump a bunch of (relatively uninteresting, but required)
> graphs from within a loop, possibly interspeded with some tables. This
> is not possible within a normal fig=TRUE chunk.
>
> odfInsertPlot() is able to insert a previously saved plot. When used in
> a fig=TRUE, results=hide chunk, it produces just a blank frame (with a
> caption if caption=odfFigureCaption() is used).
>
> Used in a fig=TRUE, results=xml chunk, it produces an error at file
> rte-assembly (see end of post). However, when wrapped in a cat(), the
> same code produces 1) the figure (without caption), then a blank frame
> with the caption, or just the figure (without caption) if the caption=()
> argument is absent.
>
> The same cat(odfInsertPlot()) construct can be used in a results=xml
> chunk (no fig=TRUE) ; however, I found no way to insert the caption.
>
> Therefore : I can programmatically create graphs and insert them via
> results=xml chunks, but I can't caption them.

We had to do some interesting things to get figure captions working
with odfWeave. You would think that the figure caption function just
write out some xml and are done (like the insert plot code and the
table caption code). Unfortunately, it doesn't.

It writes the caption to a global variable (I know, I know) and other
code actually writes the caption. We had good reason to do this,
mostly related to the complexity associated with the context of the
code chunk (e.g. was it inside a table, at paragraph, etc). I've been
thinking about this one for a while since the current implementation
doesn't allow you to pass the figure caption to other functions (it
writes a global variable and returns NULL). I haven't come up with a
good solution yet.


I've not been as prompt with odfWeave changes in comparison to other
packages (many of you have figured this out). This is mostly due to
the necessary complexity of the code. In a lot of ways, I think that
we let the feature set be too rich and should have put some constrains
on the availability of code chunks (e.g. only in paragraphs). I want
to add more features (like the one that you are requesting), but
seemingly small changes end up being a considerable amount of work
(and I don't time). I've been thinking about simplifying the code (or
writing rtfWeave) to achieve the same goals without such a complex
system.

The ODF format is a double-edged sword. It allows you to do many more
things than something like RTF, but makes it a lot more difficult to
program for. Take tables as an example. The last time I looked at the
RTF specification, this was a simple markup structure. In ODF, the
table structure is somewhat simple, but the approach to formatting the
table is complex and not necessarily well documented. For example,
some table style elements go into styles.xml whereas others go into
contest.xml (this might be implementation dependent)

So, I could more easily expand the functionality of odfWeave by
imposing some constraints about where the code chunks reside. The
earlier versions of odfWeave did not even parse the xml; we got a lot
done via regular expressions and gsub. However, we went to a xml
parsing approach when we found out that the context of the code chunk
matters.

Feedback is welcome: do people actually use code chunks in places
other than paragraphs?


So, back to your question, the relevant code for captions is in
odfWeave:::withCaptionXML (odfInsertPlot uses this to write the xml).
You can try that and I might be able to look at it in the next few
days.

Thanks,

Max

__
R-help@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.


Re: [R] odfWeave : problems with odfInsertPlot() and odfFigureCaption()

2009-07-01 Thread Emmanuel Charpentier
Dear Max,

Le mardi 30 juin 2009 à 21:36 -0400, Max Kuhn a écrit :
> Well, on this one, I might bring my record down to commercial software
> bug fix time lines...

Having actually looked at the code before wailing, I had such a hunch...

[ Snip ... ]

> We had to do some interesting things to get figure captions working
> with odfWeave. You would think that the figure caption function just
> write out some xml and are done (like the insert plot code and the
> table caption code). Unfortunately, it doesn't.
> 
> It writes the caption to a global variable (I know, I know) and other
> code actually writes the caption. We had good reason to do this,
> mostly related to the complexity associated with the context of the
> code chunk (e.g. was it inside a table, at paragraph, etc). I've been
> thinking about this one for a while since the current implementation
> doesn't allow you to pass the figure caption to other functions (it
> writes a global variable and returns NULL). I haven't come up with a
> good solution yet.

ISTR from my Lisp/Scheme days that a good heuristic in this kind of case
is to try to build a closure and return that to a wrapper.
Unfortunately, R doesn't have anything as simple to use as let/let*, and
you have to play fast and loose with environments...

> 
> I've not been as prompt with odfWeave changes in comparison to other
> packages (many of you have figured this out). This is mostly due to
> the necessary complexity of the code. In a lot of ways, I think that
> we let the feature set be too rich and should have put some constrains
> on the availability of code chunks (e.g. only in paragraphs).

I didn't even think of this. A priori, that's hard to do (whereas
(\La)Texw will need "\par" or *two* newlines to end a paragraph and
start another, oowriter will take one newline as an end of paragraph and
will emit the corresponding XML.

Come to think of it, you might try to insert a chunk in a table case, or
in a footnote...

And I don't know about other ODF tools...

>   I want
> to add more features (like the one that you are requesting), but
> seemingly small changes end up being a considerable amount of work
> (and I don't time). I've been thinking about simplifying the code (or
> writing rtfWeave) to achieve the same goals without such a complex
> system.

What about something along the line of :
foo<-odfTable(something)
bar<-odfInsertPlot(somethingelse)
odfCaptionize(foo,"Something")
odfCaptionize(bar("Something else")
?

> The ODF format is a double-edged sword. It allows you to do many more
> things than something like RTF, but makes it a lot more difficult to
> program for. Take tables as an example. The last time I looked at the
> RTF specification, this was a simple markup structure. In ODF, the
> table structure is somewhat simple, but the approach to formatting the
> table is complex and not necessarily well documented.

Indeed...

>For example,
> some table style elements go into styles.xml whereas others go into
> contest.xml (this might be implementation dependent)
> 
> So, I could more easily expand the functionality of odfWeave by
> imposing some constraints about where the code chunks reside. The
> earlier versions of odfWeave did not even parse the xml; we got a lot
> done via regular expressions and gsub. However, we went to a xml
> parsing approach when we found out that the context of the code chunk
> matters.
> 
> Feedback is welcome: do people actually use code chunks in places
> other than paragraphs?
> 

I didn't even think of it. But now that you tell it, you got me a nice
idea for a workaround ... :-)

> So, back to your question, the relevant code for captions is in
> odfWeave:::withCaptionXML (odfInsertPlot uses this to write the xml).
> You can try that and I might be able to look at it in the next few
> days.

I did look that. Tjhe problem is that your code has dire warnings not to
call it with a caption more than once in a figure=TRUE (sic..) chunk.

> Thanks,

*I* thank *you, Max,

Emmanuel Charpentier

__
R-help@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.


[R] odfWeave & xtable still best packages to produce tables?

2009-03-11 Thread Jason Rupert

Just a quick question - I did a quick search of the R-search 
(http://search.r-project.org/nmz.html) [thanks to David Winsemius for 
recommending this neat R search engine] and R-seek (http://www.rseek.org/) 
trying to find a package(s) in order to produce publication quality tables.  

I found several references to odfWeave and xtable.  My question is, are those 
still best R packages to produce publication quality tables tables from R?

Thank you for any feedback and insights. 

P.S. I know I should be trying to "Using Graphs Instead of Tables", but some 
customers (bosses) still like seeing tables.  Thanks again:)

__
R-help@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.


Re: [R] odfWeave & xtable still best packages to produce tables

2009-03-11 Thread Max Kuhn
Jason,

> I found several references to odfWeave and xtable.  My question is, are those 
> still best R packages to produce publication quality tables tables from R?

I think the file type you want (and how you will use the output)
should probably drive your choice. If you are going to pdf, then
Sweave/xtable/Hmisc:::latex are the best choices. If you are going to
a more editable file format (doc or odt), then consider odfWeave or
pdf/odf converter (which I think what Dr. Harrell does). HTML is
always an option, but you'll have to covert the document if that is
not your target format.

-- 

Max

__
R-help@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.


[R] odfWeave : change of text style of output is ignored

2009-03-20 Thread Fredrik Karlsson
Dear list,

The output of my embedded code sections come out in the style "ttBlue" wich
is Times New Roman and Blue when I open document. I would like to change
this to a fixed witdth font, smaller and less blue by using style
definitions in the document, but it really does not affect the output.

I tried including

getStyleDefs() -> styl
styl$ttBlue$fontname <- "Courier"
styl$ttBlue$fontSize <- "9pt"
styl$ttBlue$fontColor <- "#00"
setStyleDefs(styl)

at the beginning of the document, but the output is still blue, not fixed
width and still 10pt.

Any ideas on how to get this to work?

/Fredrik

-- 
"Life is like a trumpet - if you don't put anything into it, you don't get
anything out of it."

[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] odfWeave : change of text style of output is ignored

2009-03-20 Thread Max Kuhn
Did you do this within the document, or prior to running odfWeave?

Also, please provide the output of sessionInfo() after starting odfWeave.

Max

On Fri, Mar 20, 2009 at 11:03 AM, Fredrik Karlsson  wrote:
> Dear list,
>
> The output of my embedded code sections come out in the style "ttBlue" wich
> is Times New Roman and Blue when I open document. I would like to change
> this to a fixed witdth font, smaller and less blue by using style
> definitions in the document, but it really does not affect the output.
>
> I tried including
>
> getStyleDefs() -> styl
> styl$ttBlue$fontname <- "Courier"
> styl$ttBlue$fontSize <- "9pt"
> styl$ttBlue$fontColor <- "#00"
> setStyleDefs(styl)
>
> at the beginning of the document, but the output is still blue, not fixed
> width and still 10pt.
>
> Any ideas on how to get this to work?
>
> /Fredrik
>
> --
> "Life is like a trumpet - if you don't put anything into it, you don't get
> anything out of it."
>
>        [[alternative HTML version deleted]]
>
> __
> R-help@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.
>



-- 

Max

__
R-help@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.


Re: [R] odfWeave : change of text style of output is ignored

2009-03-20 Thread Fredrik Karlsson
Dear Max,

I was including the settings in my document, but I also tried setting it
from the command line. This resulted in more of a change, but only in that
the ttBlue now being defined as black rather than blue. So, some effect, but
not all the way.

Here is the session info:

> sessionInfo()
R version 2.8.1 (2008-12-22)
i386-apple-darwin8.11.1

locale:
sv_SE.UTF-8/sv_SE.UTF-8/C/C/sv_SE.UTF-8/sv_SE.UTF-8

attached base packages:
[1] stats graphics  grDevices utils datasets  methods   base

other attached packages:
[1] car_1.2-12  nlme_3.1-90 odfWeave_0.7.9  XML_2.3-0
lattice_0.17-20

loaded via a namespace (and not attached):
[1] MASS_7.2-46grid_2.8.1 latticeExtra_0.5-4

/Fredrik



On Fri, Mar 20, 2009 at 4:06 PM, Max Kuhn  wrote:

> Did you do this within the document, or prior to running odfWeave?
>
> Also, please provide the output of sessionInfo() after starting odfWeave.
>
> Max
>
> On Fri, Mar 20, 2009 at 11:03 AM, Fredrik Karlsson 
> wrote:
> > Dear list,
> >
> > The output of my embedded code sections come out in the style "ttBlue"
> wich
> > is Times New Roman and Blue when I open document. I would like to change
> > this to a fixed witdth font, smaller and less blue by using style
> > definitions in the document, but it really does not affect the output.
> >
> > I tried including
> >
> > getStyleDefs() -> styl
> > styl$ttBlue$fontname <- "Courier"
> > styl$ttBlue$fontSize <- "9pt"
> > styl$ttBlue$fontColor <- "#00"
> > setStyleDefs(styl)
> >
> > at the beginning of the document, but the output is still blue, not fixed
> > width and still 10pt.
> >
> > Any ideas on how to get this to work?
> >
> > /Fredrik
> >
> > --
> > "Life is like a trumpet - if you don't put anything into it, you don't
> get
> > anything out of it."
> >
> >[[alternative HTML version deleted]]
> >
> > __
> > R-help@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.
> >
>
>
>
> --
>
> Max
>



-- 
"Life is like a trumpet - if you don't put anything into it, you don't get
anything out of it."

[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] odfWeave : change of text style of output is ignored

2009-03-20 Thread Max Kuhn
> I was including the settings in my document, but I also tried setting it
> from the command line. This resulted in more of a change, but only in that
> the ttBlue now being defined as black rather than blue. So, some effect, but
> not all the way.

You will have to define the styles before calling odfWeave, but you
can set them within the document anywhere. Can you send me (off-list)
a self contained example odt file and R script?

Thanks,

Max

__
R-help@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.


[R] odfWeave: in multi-page plots only last page appears in document

2008-04-14 Thread Tobias Sing
Dear all,

Max, first of all, many thanks for providing the odfWeave package.

My problem: Whenever I have multiple plots in one single chunk of my
ODF file, only the last plot gets shown. The problem can be reproduced
with this toy example (to be used in an ODF file together with
odfWeave -- I'm using the newest version 0.7.3):

<>=
for (i in 1:3) {
plot(1,1, main=paste('Plot',i))
}
@

I thought the solution (I hope there is one) might be found with
setImageDefs (e.g. by setting type and/or device to postscript and
working with the 'onefile' argument) , but I couldn't solve the
problem. So maybe this is not the right idea for a solution. In any
case, here is my current getImageDefs:

> getImageDefs()
$type
[1] "png"

$device
[1] "png"

$plotHeight
[1] 480

$plotWidth
[1] 480

$dispHeight
[1] 5

$dispWidth
[1] 5

$args
list()

Any help appreciated.
Kind regards,
  Tobias

__
R-help@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.


Re: [R] odfWeave: in multi-page plots only last page appears in document

2008-04-14 Thread Sarah Goslee
If you ran that code outside ODFWeave, you'd only get one plot,
so why would you expect to get more within ODFWeave?

for (i in 1:3) {
> plot(1,1, main=paste('Plot',i))
>  }

You need to add some sort of par() command, or use layout(), to create
a single plot that contains all three of the plots created by the loop.

par(mfrow=c(2,2))
for (i in 1:3) {
plot(1,1, main=paste('Plot',i))
}
for example.

Or, if you want ODFWeave to handle placement, then you need to
break that into three separate plots.

Sarah


On Mon, Apr 14, 2008 at 2:20 PM, Tobias Sing <[EMAIL PROTECTED]> wrote:
> Dear all,
>
>  Max, first of all, many thanks for providing the odfWeave package.
>
>  My problem: Whenever I have multiple plots in one single chunk of my
>  ODF file, only the last plot gets shown. The problem can be reproduced
>  with this toy example (to be used in an ODF file together with
>  odfWeave -- I'm using the newest version 0.7.3):
>
>  <>=
>  for (i in 1:3) {
> plot(1,1, main=paste('Plot',i))
>  }
>  @
>

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

__
R-help@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.


Re: [R] odfWeave: in multi-page plots only last page appears in document

2008-04-14 Thread Kuhn, Max
Another option, if you want them in separate figures, is to write a loop
that generates the image file, saves it to the file system, and use
odfInsertPlot to put the file into the document.

This might work better if you have an unknown number of images that you
want to insert.

Max 

-Original Message-
From: Sarah Goslee [mailto:[EMAIL PROTECTED] 
Sent: Monday, April 14, 2008 2:32 PM
To: Tobias Sing
Cc: r-help; Kuhn, Max
Subject: Re: [R] odfWeave: in multi-page plots only last page appears in
document

If you ran that code outside ODFWeave, you'd only get one plot, so why
would you expect to get more within ODFWeave?

for (i in 1:3) {
> plot(1,1, main=paste('Plot',i))
>  }

You need to add some sort of par() command, or use layout(), to create a
single plot that contains all three of the plots created by the loop.

par(mfrow=c(2,2))
for (i in 1:3) {
plot(1,1, main=paste('Plot',i))
}
for example.

Or, if you want ODFWeave to handle placement, then you need to break
that into three separate plots.

Sarah


On Mon, Apr 14, 2008 at 2:20 PM, Tobias Sing <[EMAIL PROTECTED]>
wrote:
> Dear all,
>
>  Max, first of all, many thanks for providing the odfWeave package.
>
>  My problem: Whenever I have multiple plots in one single chunk of my

> ODF file, only the last plot gets shown. The problem can be reproduced

> with this toy example (to be used in an ODF file together with  
> odfWeave -- I'm using the newest version 0.7.3):
>
>  <>=
>  for (i in 1:3) {
> plot(1,1, main=paste('Plot',i))
>  }
>  @
>

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

__
R-help@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.


Re: [R] odfWeave: in multi-page plots only last page appears in document

2008-04-14 Thread Tobias Sing
Sarah, thanks for your reply.

On Mon, Apr 14, 2008 at 8:32 PM, Sarah Goslee <[EMAIL PROTECTED]> wrote:
> If you ran that code outside ODFWeave, you'd only get one plot,
>  so why would you expect to get more within ODFWeave?

No, it depends on the device that is used. If I use PDF or postscript
they all go into different pages of a single file. This is why I was
referring to setImageDefs as a guess for a solution in my original
post, but couldn't get it to work. Your suggestion of par/layout is
unfortunately not what I'm looking for. I was hoping that the
individual plots would come one after the other in the ODF document.
And I also hope that 'pedestrian' solution of breaking into separate
chunks in the ODF file has an alternative, because often this would
required a rewrite of functions.

Any other hints?

Thanks,
  Tobias



>
>
>  for (i in 1:3) {
>  > plot(1,1, main=paste('Plot',i))
>  >  }
>
>  You need to add some sort of par() command, or use layout(), to create
>  a single plot that contains all three of the plots created by the loop.
>
>  par(mfrow=c(2,2))
>
> for (i in 1:3) {
> plot(1,1, main=paste('Plot',i))
>  }
>  for example.
>
>  Or, if you want ODFWeave to handle placement, then you need to
>  break that into three separate plots.
>
>  Sarah
>
>
>
>
>  On Mon, Apr 14, 2008 at 2:20 PM, Tobias Sing <[EMAIL PROTECTED]> wrote:
>  > Dear all,
>  >
>  >  Max, first of all, many thanks for providing the odfWeave package.
>  >
>  >  My problem: Whenever I have multiple plots in one single chunk of my
>  >  ODF file, only the last plot gets shown. The problem can be reproduced
>  >  with this toy example (to be used in an ODF file together with
>  >  odfWeave -- I'm using the newest version 0.7.3):
>  >
>  >  <>=
>  >  for (i in 1:3) {
>  > plot(1,1, main=paste('Plot',i))
>  >  }
>  >  @
>  >
>
>  --
>  Sarah Goslee
>  http://www.functionaldiversity.org
>

__
R-help@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.