showtext和cairo包可以解决,在mac下:
library(showtext)
library(cairo)
showtext_auto(enable=T)
font_add("MicrosoftYaHei","/System/Library/Fonts/msyh.ttf") #微软雅黑字体#
ggplot(......) #ggplot2绘图#
ggsave("ggplot2.pdf",device=cairo_pdf,width=8,height=8) #选择cairo的pdf格式输出#