Hello All,
Have recently started learning Sweave and Knitr. Am now trying to learn
odfWeave as well. Things went pretty smoothly with Sweave and Knitr but I'm
having some trouble with odfWeave.
My understanding was that odfWeave should work in pretty much the same way as
Sweave. With odfWeave, you set up an input .odt file in a folder, run that file
through the odfWeave function, and then the function produces an output .odt
file in the same folder.
So I decided to try that using a file called simple.odt that comes with the
odfWeave package. Unfortunately, things didn't work out quite as I had hoped.
Below is the result of my attempt to odfWeave that file via Emacs.
For some reason, odfWeave is setting the wd to a location on the C drive when
my input file is on the N drive. I tried altering this by setting the location
of workDir to my folder on the N drive. odfWeave through up an error saying
that this folder already exists. So perhaps the files are supposed to be
processed in a location other than the one where the input file resides.
The other thing is that odfWeave is finding an unexpected "&". There is text in
the "simple.odt" input file that looks like "paste(levels(iris$Species),
collapse = " but it has no "&". So presumably something is wrong in the xml
markup that is being produced.
If anyone can help me understand what is going wrong here, that would be
greatly appreciated.
Thanks,
Paul
> library(odfWeave)
Loading required package: lattice
Loading required package: XML
> inFile <- paste(fp, "simple.odt", sep="")
> outFile <- paste(fp, "output.odt", sep="")
> odfWeave(inFile, outFile)
Copying N:/Studies/HCRPC1211/Documentation/R Documentation/odfWeave
Documentation/Examples/Example 1/simple.odt
Setting wd to
C:\Users\pmiller\AppData\Local\Temp\3\RtmpMlDMHV/odfWeave18071055703
Unzipping ODF file using unzip -o "simple.odt"
Archive: simple.odt
extracting: mimetype
inflating: meta.xml
inflating: settings.xml
inflating: content.xml
extracting: Thumbnails/thumbnail.png
inflating: layout-cache
inflating: manifest.rdf
creating: Configurations2/popupmenu/
creating: Configurations2/images/Bitmaps/
creating: Configurations2/toolpanel/
creating: Configurations2/statusbar/
creating: Configurations2/toolbar/
creating: Configurations2/progressbar/
creating: Configurations2/menubar/
creating: Configurations2/floater/
inflating: Configurations2/accelerator/current.xml
inflating: styles.xml
inflating: META-INF/manifest.xml
Removing simple.odt
Creating a Pictures directory
Pre-processing the contents
Sweaving content.Rnw
Writing to file content_1.xml
Processing code chunks ...
Error in parse(text = cmd) : <text>:1:40: unexpected '&'
1: paste(levels(iris$Species), collapse = &
^
>
[[alternative HTML version deleted]]
______________________________________________
[email protected] 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.