aphalo / ggspectra

R package 'ggspectra' (from r4photobiology suite)
https://docs.r4photobiology.info/ggspectra
5 stars 0 forks source link

CRAN check failure #7

Closed aphalo closed 11 months ago

aphalo commented 1 year ago

Correct before 2023-11-14

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.

-- Brian D. Ripley, ripley@stats.ox.ac.uk Emeritus Professor of Applied Statistics, University of Oxford

aphalo commented 1 year ago

This is posibly caused by use of "mu" instead of "micro" in UTF-8 unit prefixes in si-prefixes.R now changes but needs testing.

aphalo commented 1 year ago

I am not sure "micro" really solves the problem everywhere but should allow the package to pass CRAN checks as "micro" is available in the Latin-1 encoding.

aphalo commented 1 year ago

Tested in rhub and seems to be o.k.