Dear R-users, Just like other users (as seen from previous posts on the list), I would like to use female and male signs in plots. I found B. Ripley's post about using Unicode characters. However, it doesn't works for me. > text(locator(1),"\u2640") produces the following error: Error: invalid \uxxxx sequence But I can specify other Unicode characters as long I don't exceed 00FF, so this works > text(locator(1),"\u00FF") or > text(locator(1),"\u00E6") and also without preceeding 00 > text(locator(1),"\uE6") Can someone give me a hint? I'm using a Swedish locale on WindowsXP and my R version is 2.3.1 Patched (2006-06-04 r38279) Thanks, Hans Gardfjell -- ********************************* Hans Gardfjell Ecology and Environmental Science Ume? University 90187 Ume?, Sweden email: hans.gardfjell at emg.umu.se phone: +46 907865267 mobile: +46 705984464
On Thu, 8 Jun 2006, Hans Gardfjell wrote:> Dear R-users, > > Just like other users (as seen from previous posts on the list), I would > like to use female and male signs in plots. I found B. Ripley's post > about using Unicode characters. However, it doesn't works for me. > > > text(locator(1),"\u2640") produces the following error: > Error: invalid \uxxxx sequence > > But I can specify other Unicode characters as long I don't exceed 00FF, > so this works > > > text(locator(1),"\u00FF") or > > text(locator(1),"\u00E6") and also without preceeding 00 > > text(locator(1),"\uE6") > > Can someone give me a hint? > I'm using a Swedish locale on WindowsXP and my R version is 2.3.1 > Patched (2006-06-04 r38279)Hans, R> edit(vignette("Ch_logistic_regression_glm", package = "HSAUR")) (you need to install package `HSAUR') has an example, specifically the line text(womensrole$education, y, ifelse(f, "\\VE", "\\MA"), vfont c("serif", "plain"), cex = 1.25) uses Hershey fonts, see ?Hershey Torsten> > Thanks, > > Hans Gardfjell > > -- > > ********************************* > Hans Gardfjell > Ecology and Environmental Science > Ume? University > 90187 Ume?, Sweden > email: hans.gardfjell at emg.umu.se > phone: +46 907865267 > mobile: +46 705984464 > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! R-project.org/posting-guide.html > >
On Thu, 8 Jun 2006, Hans Gardfjell wrote:> Dear R-users, > > Just like other users (as seen from previous posts on the list), I would > like to use female and male signs in plots. I found B. Ripley's post > about using Unicode characters. However, it doesn't works for me. > > > text(locator(1),"\u2640") produces the following error: > Error: invalid \uxxxx sequence > > But I can specify other Unicode characters as long I don't exceed 00FF, > so this works > > > text(locator(1),"\u00FF") or > > text(locator(1),"\u00E6") and also without preceeding 00 > > text(locator(1),"\uE6") > > Can someone give me a hint? > I'm using a Swedish locale on WindowsXP and my R version is 2.3.1 > Patched (2006-06-04 r38279)Unicode characters only work if they are valid in the locale: for these, only in UTF-8 locales (hence not on Windows). If you were referring to finzi.psych.upenn.edu/R/Rhelp02a/archive/63615.html it did say You don't tell us your platform and the answer depends on the platform. Alternatively, look at the Hershey fonts, which have these and many other symbols (not necessarily of publication-quality though). -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, 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