This works as expected
---
title: "insert image"
output:
pdf_document:
latex_engine: xelatex
---
Save the plot in a png file to include later
```{r}
graph <- "plot.png"
library(ggplot2)
p <- ggplot(mpg, aes(class, hwy)) + geom_boxplot()
ggsave(graph, p)
```
Include the file in the pdf
```{r}
knitr::include_graphics(graph)
```
I guess you are doing something different and having a reproducible example would really help (FAQ: What's a reproducible example (`reprex`) and how do I do one?)