My problem is that I wanted to knit an .Rmd file with the setting dev = 'pdf', to get all the plots in pdf format. The problem is that my language is Hungarian so I would need "ő" charachter in the figure, which is missing.
As an example the legend title "egy főre eső" becomes "egy fore eso".
The problem do not emerge, when dev = "png" or anything else, but I need pdf.
I think you need to play with the argument of pdf() function so that it supports a font with those characters. It uses postscript if I understand well. Graphic devices is not something I find easy.
You could also try other pdf devices
the cairo_pdf device from grDevices,
or Cairo::CairoPDF()
You could also be interested in this article about how to use fonts with R graphics.