[R] OdfWeave and Locale

C.H. chainsawtiney at gmail.com
Wed Sep 1 07:45:33 CEST 2010


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



More information about the R-help mailing list