There have been encoding-related problems in odfWeave for years,
and notice that it fails its checks on Windows (see the CRAN package
check page).
However, the problem here appears to be directional quotes, and you
may be able to resolve these in the same ways as in Sweave (one of
which is to use options(fancyQuotes = FALSE)).
On Wed, 1 Sep 2010, C.H. wrote:
> Dear all,
>
> I have a question regarding the odfweave. I created an odt file
> (test_input.odt) using OO.o for WIndows XP. The code is generic.
>
> ---- Code for odt -----------
>
> \Sexpr{dim(iris)[1]}
>
> <<listofSpecies, echo=FALSE, results=xml>>>
odfItemize(levels(iris$Species))
> @
>
> Table 1:
>
> <<Table, echo=FALSE, results=xml>>> data.frame(N
=tapply(iris$Petal.Length, iris$Species, length) ,mean >
tapply(iris$Petal.Length, iris$Species, mean), sd> tapply(iris$Petal.Length,
iris$Species, sd))
> @
>
> one way anova, p=
\Sexpr{summary(aov(iris$Petal.Length~iris$Species))[[1]][1,5]}
>
> ---- Code for odt -----------
>
> When I try to use the odfWeave command to process the input file, the
> following error is encountered.
>
> ------ R output --------
>
> odfWeave("test_input.odt","output.odt")
> Copying test_input.odt
> Setting wd to
> C:\DOCUME~1\kwhuser\LOCALS~1\Temp\Rtmpnblj4D/odfWeave01132749455
> Unzipping ODF file using unzip -o "test_input.odt"
> Archive: test_input.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: manifest.rdf
> inflating: styles.xml
> extracting: meta.xml
> inflating: Thumbnails/thumbnail.png
> inflating: settings.xml
> inflating: META-INF/manifest.xml
>
> Removing test_input.odt
> Creating a Pictures directory
>
> Pre-processing the contents
> Error in gsub("\xe2\u0080\x93", "-", x) :
> 'pattern' is invalid in this locale
>
> ------ R output --------
>
> I would like to know how to fix that. Thank you.
>
> The following are the session info and the locale information.
>
> ---- Session info -----
>
> sessionInfo()
> R version 2.10.1 (2009-12-14)
> i386-pc-mingw32
>
> locale:
> [1] LC_COLLATE=Chinese_Hong Kong S.A.R..950 LC_CTYPE=Chinese_Hong
> Kong S.A.R..950
> [3] LC_MONETARY=Chinese_Hong Kong S.A.R..950 LC_NUMERIC=C
> [5] LC_TIME=Chinese_Hong Kong S.A.R..950
>
> attached base packages:
> [1] stats graphics grDevices utils datasets methods base
>
> other attached packages:
> [1] odfWeave_0.7.11 XML_3.1-1 lattice_0.17-26
>
> loaded via a namespace (and not attached):
> [1] grid_2.10.1
>
> ---- Session info -----
>
> Thank you.
>
> CH
>
> --
> CH Chan
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
--
Brian D. Ripley, ripley at stats.ox.ac.uk
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, UK Fax: +44 1865 272595