Re: [R] Locale problem with umlauts in factor levels in 2.7.0 (patched) from grid or lattice

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Fri, 02 May 2008 08:02:39 +0100 (BST)

The bug is in grid, in some layout calculations which need the string width. There was a 'FIXME' in the sources, and I've fixed this now. (svn r45579/80). Many other grid examples worked so it took me a while to track this down.

On Thu, 1 May 2008, Dieter Menne wrote:

> With 2.7.0 patched (not tested with 2.0.0), I get an error message in a
> program that ran correctly in R 2.6.2 when the grouping factor of a
> stripplot contains an Umlaut:
> I am aware that there are a few locale-changes in R 2.7.0, but I could not
> easily
> locate who's at fault
>
> Dieter
>
>
> library(lattice)
> dt = data.frame(x=rnorm(100),y=1:100,levs= as.factor(c("Gru","Grü")))
> stripplot(x ~ y|levs, data = dt)
> #Error in grid.Call.graphics("L_text", as.graphicsAnnot(x$label), x$x, :
> # invalid input 'Grü' in 'utf8towcs'
>> # Works
> as.graphicsAnnot(as.factor(c("Gru","Grü")))
>
>
>
> R version 2.7.0 Patched (2008-04-30 r45572)
> i386-pc-mingw32
>
> locale:
> LC_COLLATE=German_Germany.1252;LC_CTYPE=German_Germany.1252;
> LC_MONETARY=German_Germany.1252;LC_NUMERIC=C;LC_TIME=German_Germany.1252
>
> attached base packages:
> [1] stats graphics grDevices utils datasets methods base
>
> other attached packages:
> [1] lattice_0.17-6
>
> loaded via a namespace (and not attached):
> [1] grid_2.7.0
>
> ______________________________________________
> 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


______________________________________________ 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.

Received on Fri 02 May 2008 - 07:05:19 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 02 May 2008 - 07:30:33 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive