Is it possible to build text with a mirror image in R?

I know there is a str argument in a text function; It would be nice if I could build mirror letters / strings ... Any idea?

+7
r
source share
2 answers

You can play with grImport, but it's pretty confusing

enter image description here

library(grImport) cat("%!PS /Times-Roman findfont 100 scalefont setfont newpath 0 0 moveto -1 1 scale (hello) show", file="hello.ps") PostScriptTrace("hello.ps", "hello.xml") hello <- readPicture("hello.xml") grid.newpage() grid.picture(hello) 
+10
source share

Here's a solution based on the all-powerful tikzDevice package in which LaTeX processes strings

 library(tikzDevice) tikz("mirror.tex", standAlone = TRUE, height=2,width=4) plot(1,1, xlab="\\reflectbox{Otto and Hannah mostly won't care}") dev.off() 

enter image description here

+3
source share

All Articles