If you are using Rmarkdown, you are using pandoc because it is what does the conversion from markdown to other formats. Inside R, you can call
rmarkdown::pandoc_version()
If you use RStudio, it is shipped with the IDE installation. If you don't you need to install it.
Also, you yaml header need to have correct indentation and you need to use xelatex engine for latext, as explain in the doc I linked above
From pandoc MANUAL:
When using LaTeX for bidirectional documents, only the xelatex engine is fully supported (use --pdf-engine=xelatex ).
This is what tried @jdb in his answer and This is working for him.
---
title: 'one'
author: "me"
date: "7/26/2019"
output:
pdf_document:
latex_engine: xelatex
dir: rtl
----