Issues knitting to pdf in rmarkdown

I am trying to knit my R markdown document to pdf. It works fine when I knit to html, but R markdown returns the error below when I try to knit to pdf:

! Package inputenc Error: Unicode char − (U+2212)
(inputenc) not set up for use with LaTeX.

See the inputenc package documentation for explanation.
Type H for immediate help.

l.398 −

Try running pandoc with --latex-engine=xelatex.
pandoc: Error producing PDF
Error: pandoc document conversion failed with error 43
Execution halted

Try switching which LaTex typeset you are using. Find this in:

Tools > Global Options > Sweave > Typeset LaTex into PDF using:

1 Like

Thank you very much @dlsweet

1 Like