Forums | OpenR
OpenR: R & Statistics
/
A question about knit to PDF
20 March 2022, 12:11 AM
20 March 2022, 11:07 AM
Has your problem been solved? I do not see anything relevant to ggplot2, as Liancheng suggested.
20 March 2022, 12:06 PM
Because I had the same error and found it was the porblem of ggplot2 warning. Maybe ‘输入的字符串1不适用于此语言环境’ is the problem of ‘Warning message:
程辑包'ggplot2'是用R版本4.1.1 来建造的’
20 March 2022, 2:01 PM
I see. Now I know what is going on. The problem is that the default setting does not support knitting a document with Chinese characters or other multibyte characters into pdf, unless you declare some support from LaTeX settings and packages.
In this case, when you load the ggplot2 package, some messages in Chinese are generated in the document. Yes, suppressing the messages is a solution, but I would suggest that you switch to the English environment (change your computer's locale to English) so that the messages in R will be displayed in English.