I am trying to knit a document from RStudio to pdf, but I am getting the following error (attached). I have made a MWE that replicates my problem.
I have Rstudio 2022.12.0 on Windows 10 Pro with R 4.2.2, along with TexLive 2022 and Pandoc installed. The latest version of tinytex is installed, and updated.
A similar question is here: Error with Unicode escape character U+001B knitting .rmd to .pdf but mine problem seems to be slightly different since it involves the compile_document command from the file menu on a normal R script rather than a Rmd script.
I have reinstalled TexLive, Reinstalled R and reinstalled RStudio but with no success. I've also changed the rendering engine between pdflatex and xelatex, and changed from swerve to knitr. None of these have worked.
Code is below
require(tidyverse)
a <- mtcars
g <- a %>%
ggplot()+
aes(x = mpg,
y = wt)+
geom_point()
print(g)