project-gen3sis / R-package

Repository of the R-packageGen3sis
https://project-gen3sis.github.io/R-package/
GNU General Public License v3.0
29 stars 9 forks source link

Unicode Greek letters and symbols in plots #66

Closed ohagen closed 1 year ago

ohagen commented 1 year ago

FIX UNTIL 2023-11-14 Subject: CRAN packages using Unicode Greek letters and symbols in plots

These are not portable: the pdf() and postscript() devices only support characters in an 8-bit locale, usually Latin-1, and R CMD check uses pdf(), on CRAN in a Western European UTF-8 locale where pdf() uses Latin-1. In most cases you should be using plotmath ....

Checking with environment varianble _R_CHECK_MBCS_CONVERSIONFAILURE set to a non-empty value will throw an error in current R-devel, although you can also grep the .Rcheck directory for 'conversion failure.*mbcsToSbcs'

Attempts to plot Greek letters on a pdf() device are seen in the checks of packages

DPQ DanielBiostatistics10th DoE.base EPGMr IOHanalyzer LMMstar SIRmcmc VisualizeSimon2Stage WRTDStidal biogeom gMCPLite gamma gen3sis ggspectra negligible oHMMed plotRCS simEd visualize

Plotmath can also be used for ∞ (utilities) ≤ (autoReg, brr, ggstats, visualize) and ≥ (simulariatools, visualize). Some versions of R will transliterate to e.g. <= or >= rather than substitute '.' but the use of plotmath will look better.

NB: the issues will not be seen on a platform whose libiconv does transliteration -- known are macOS 14 and Alpine Linux. But for example on macOS 14, the missing Greek symbols are silently substituted by ?, which is not useful.

[The cairo_pdf() and cairo_ps() devices handle fonts differently and can plot a wider (but platform-dependent) range of Unicode chars. It looks like using plotmath will suffice, but if not you could arrange for your examples/tests to use cairo_pdf() if dev.cur() shows the current device is pdf().]

Please correct before 2023-11-14 to safely retain your package on CRAN.