R-encoding of the header in Pdf

This question is related to: Rhtml: Warning: conversion failure in '<var>' to 'mbcsToSbcs': point substituted for <var> and R does not open with UTF-8

I use Ubuntu, I can not show the Turkish character, ı , by the name of the plot:

myScript.r :

 pdf(file='/home/sait/Desktop/abc.pdf') plot(1:7,1:7,main='geziparkı') 

I have the following warning messages when I run a script using Rscript myScript.r ,

 Warning messages: 1: In title(...) : conversion failure on 'geziparkı' in 'mbcsToSbcs': dot substituted for <c4> 2: In title(...) : conversion failure on 'geziparkı' in 'mbcsToSbcs': dot substituted for <b1> 3: In title(...) : conversion failure on 'geziparkı' in 'mbcsToSbcs': dot substituted for <c4> 4: In title(...) : conversion failure on 'geziparkı' in 'mbcsToSbcs': dot substituted for <b1> 

I added the line pdf.options(encoding='ISOLatin2.enc') at the top of my script, as mentioned in previous previous questions, did not help.

I need to change something from the locale settings of Ubuntu. My sessioinInfo() next,

 > sessionInfo() R version 2.15.2 (2012-10-26) Platform: x86_64-pc-linux-gnu (64-bit) locale: [1] LC_CTYPE=tr_TR.UTF-8 LC_NUMERIC=C [3] LC_TIME=tr_TR.UTF-8 LC_COLLATE=tr_TR.UTF-8 [5] LC_MONETARY=tr_TR.UTF-8 LC_MESSAGES=C [7] LC_PAPER=C LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=tr_TR.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base 

PS: I continue to research this problem and realized that if I use .png it works fine, only the problem with .pdf .

+4
source share
1 answer

Finally, I found a solution,

Substituting pdf(file='/home/sait/Desktop/abc.pdf') with cairo_pdf('/home/sait/Desktop/abc.pdf', family="DejaVu Sans") did the trick.

I do not know what this actually did, however I tried many things and nothing worked except for this.

+7
source

Source: https://habr.com/ru/post/1498437/


All Articles