I think one problem is that you have the chunk defined as
library(ggplot2)
ggplot(ToothGrowth, aes(x=dose, y=len, fill=dose, group=dose)) +
geom_boxplot()+
labs(title='标题',
caption='来源: 嘻嘻')
``
and you need
``` at the bottom.
Okay it looks like you need to specify an output latex engine such as latex_engine: xelatex. The default pdflatex does not seem able to d\handle Chinese characters.
Also there is a problem using Chinese characters in the ggplot command. I do not know enough about R encoding to find the problem
Here is some code that almost works but it breaks if I use Chinese characters for the ggtitle. With ggtitle("HI") it compiles and with ggtitle("标题") it breaks