From d@tr7320 @end|ng |rom un|@@ydney@edu@@u  Wed Apr  7 10:00:05 2021
From: d@tr7320 @end|ng |rom un|@@ydney@edu@@u (Dario Strbenac)
Date: Wed, 7 Apr 2021 08:00:05 +0000
Subject: [Rd] SVG Error on Windows if Multiplication Character Present
Message-ID: <SYBPR01MB4761553D4E32733B1A9ABF17CD759@SYBPR01MB4761.ausprd01.prod.outlook.com>

Good day,

The example below fails on Windows with Error in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y: Metric information not available for this family/device.

library(ggplot2)
aPlot <- ggplot(ToothGrowth, aes(x = factor(dose), y = len)) + geom_boxplot() +
         ggtitle("Test", subtitle = ggplot2::expr(paste("p", " = ", "6.23", " ? ", "10"^"-5"))) 
svg("test.svg"); aPlot; dev.off();

but there is no such problem on a Debian Linux server. The plot in Windows appears fine in an R graphics window. The error only occurs when exported as an SVG file. Using %*% instead of ? avoids the error but it's perhaps worth mentioning in case it could be easily handled by R.

--------------------------------------
Dario Strbenac
University of Sydney
Camperdown NSW 2050
Australia


[Rd] SVG Error on Windows if Multiplication Character Present
Dario Strbenac