[R] Sweave in R 2.13.1 doesn't support cp1250 encoding

Tomaz tomaz.ficko at agroruse.si
Tue Jul 12 09:01:45 CEST 2011


Prof Brian Ripley <ripley <at> stats.ox.ac.uk> writes:

> 
> On Mon, 11 Jul 2011, Tomaz wrote:
> 
> > I upgraded R on windows xp from 2.12.2 to 2.13.1 and now I can not
> > process Rnw files with windows cp1250 encoding. Sweave complains:
> 
> Which is of course not an ISO Standard encoding.  One way out is to use the
> ISO encoding latin2, which is supported.
> 
> >    file.Rnw declares an encoding that Sweave does not know about
> >
> > What can I do beside downgrade R? When will Sweave support more
> > encodings?  Has anybody found a solution?
> 
> It is a great pity that you did not raise this during the alpha/beta/RC
> period of R 2.13.0, and that you did not give the 'at a minimum'
> information asked for in the posting guide so we do not know your locale.
> Nor do we have the 'commented, minimal, self-contained, reproducible'
> example we asked for.
> 
> These things happen because of lack of cooperation from users with unusual
> requirements.  Note that in several months no one else has reported a need
> for cp1250.
> 
> The short answer is that now 2.13.1 was missed, it will be 2.14.0 and
> 2.13.1 patched: please do try a version of the latter dated tomorrow or
> later (r56361 or later) since there is no way we can test if the change
> made is adequate without your example.
> 
> Next time you wish to request an enhancement to R for an very unusual usage
> case, please write to R-devel with full details and an example.  Very much
> preferably, do so during the pre-release testing period.
> 
> >
> > Regards, Tomaz
> >
> > ______________________________________________ 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.
> >
> 


I don't think that Windows-1250 a.k.a cp1250 encoding is unusual usage case
as it is default native encoding for Rgui on Windows XP in Slovenia,
Slovakia, Hungary, Czech Republic, Romania, Albania, Croatia, Bosnia and
Serbia.


I'm providing minimal example, it's a modified example from Sweave
installation. 

%%%%%%%%%%% file: example-1.Rnw

\documentclass[a4paper]{article} \usepackage[slovene]{babel}
\usepackage[cp1250]{inputenc} \usepackage[T1]{fontenc}  

\title{Sweave Example 1} \author{Friedrich Leisch}

\begin{document}

\maketitle

In this example we embed parts of the examples from the \texttt{kruskal.test}
help page into a \LaTeX{} document:

<<>>= data(airquality, package="datasets") library("stats")
kruskal.test(Ozone ~ Month, data = airquality) @ which shows that the
location parameter of the Ozone distribution varies significantly from month
to month. Finally we include a boxplot of the data:

\begin{center} <<fig=TRUE,echo=FALSE>>= library("graphics") boxplot(Ozone ~
Month, data = airquality) @ \end{center}

\end{document}

%%%%%%%%%%%%%%%

Excerpt from R session:

> Sweave("example-1.Rnw")
Error: 'example-1.Rnw' declares an encoding that Sweave does not know about
> sessionInfo()
R version 2.13.1 (2011-07-08) Platform: i386-pc-mingw32/i386 (32-bit)

locale: [1] LC_COLLATE=Slovenian_Slovenia.1250
LC_CTYPE=Slovenian_Slovenia.1250   [3] LC_MONETARY=Slovenian_Slovenia.1250
LC_NUMERIC=C                       [5] LC_TIME=Slovenian_Slovenia.1250    

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



Best regards, Tomaz



More information about the R-help mailing list