I have changed my code slightly and I am not able to reproduce the problem. Also, I now have the problem where it just compiles and never gets to an actual error. So I assuming the state I am dealing with still has do to with the original error in the screenshot.
Any suggestions how I can fix this? I really need a solution for this.
I finally resolved the issue. I had to re-install Rstudio and it all worked. Before it I re-installed all the other packages such as markdown, knitr, and others related to the pandoc errors. The Rstudio re-install did the trick.