0

I'm trying to render an R markdown report as an HTML file. My .Rmd includes ggplot figures with Hebrew (RTL language) labels, axes titles and legends. When I render the report as HTML, the resulting file displays the Hebrew text unencoded (i.e. not as UTF-8 as needed) and unreadable.

The ggplot figures read Hebrew text from both a tibble (Hebrew factors in the data, encoded as UTF-8) and ggplot functions like ylab().

Any thoughts on how to encode Hebrew text within ggplot, in an HTML R-markdown?

Thanks, Yoav

  • It's easier to help you if you include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. – MrFlick Sep 26 '21 at 19:29
  • I had the same issue with Norwegian characters. If you are on Windows, try file encoding "windows-1252". That did the trick for me. – ViviG Oct 01 '21 at 19:36
  • Hi, thanks for the tip! Are u referring to the encoding argument in rmarkdown::render()? – yoav.raskin Oct 03 '21 at 05:45
  • Sorry about the late reply, I totally missed your comment! Yes, as `render("test.html",encoding="windows-1252")`. Hopefully it will work! Otherwise add a reproducible example so we can try to replicate your issue. – ViviG Oct 05 '21 at 19:09

0 Answers0