jrnold / ggthemes

Additional themes, scales, and geoms for ggplot2
http://jrnold.github.io/ggthemes/
1.33k stars 226 forks source link

Fix CRAN check errors #149

Closed jrnold closed 9 months ago

jrnold commented 1 year ago

Fix CRAN errors: https://cran.r-project.org/web/checks/check_results_ggthemes.html

Version: 4.2.4 Check: examples Result: ERROR Running examples in ‘ggthemes-Ex.R’ failed The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: circlefill_shape_pal
> ### Title: Filled Circle Shape palette (discrete)
> ### Aliases: circlefill_shape_pal
>
> ### ** Examples
>
> library("ggplot2")
>
> p <- ggplot(mtcars, aes(x = mpg, y = hp, shape = factor(cyl))) +
+ geom_point()
>
> p + scale_shape_tremmel()
> p + scale_shape_circlefill()
Error in grid.Call.graphics(C_points, x$x, x$y, x$pch, x$size) :
 conversion failure on '●' in 'mbcsToSbcs': for ● (U+25CF)
Calls: <Anonymous> ... drawDetails -> drawDetails.points -> grid.Call.graphics
Execution halted
jrnold commented 1 year ago

That is

FlexDotPlot RFishBC RTSA RcmdrPlugin.RiskDemo WhatsR auditor geofacet ggsurvfit ggthemes ggwordcloud gridpattern ivregEX mapmisc phonTools poker qlcMatrix rchess reporter ruta scales

These do not work in the pdf() device used for R-devel CMD check on CRAN (and for most others) and so give a check failure with R-devel CMD check --as-cran or if environment variable _R_CHECK_MBCS_CONVERSIONFAILURE is set to a non-empty value. Note that this stops at the first issue.

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, missing 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. You could arrange for your examples/tests to use cairo_pdf() if dev.cur() shows the current device is pdf() and cairo_pdf() finds the glyphs.

None of the graphics devices to which I have access were able to plot the emojis used by WhatsR.

For superscripts (reporter) another possibility is to use plotmath.

Please correct before 2023-11-14 to safely retain your package on CRAN. Do study the plots produced: CRAN submissions does not have resources to do so.

jrnold commented 9 months ago

Fixed by #150