Dario Strbenac
2021-Apr-07 08:00 UTC
[Rd] SVG Error on Windows if Multiplication Character Present
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