See this other question on the community and its answer
It seems you are not using the pandoc binary with RStudio and that there is something wrong which the one pandoc installed in your /usr/local/bin
I would follow the advice of the linked question above or try reintalling pandoc correctly if you don't want the one shipped with RStudio