Knit to PDF is extremely slow

Hi, I'm trying to knit to PDF a rmarkdown document and it has stayed at 9% for the last 15 minutes. I did install MacTex. Is there a way to make this process faster?

Thank you.

The screenshot you have posted shows the process is busy running R code, so we would need to see what is being run on that particular code chunk (unnamed-chunk-2)to tell you if there is a faster approach to whatever is that you are doing .

I reviewed that second chunk and noticed I hadn't added a # to the View function which I suppose was taking a lot of time.

Thanks!

In general, you can't execute the View() function within and Rmd file that is going to be knitted because it is obviously impossible to open a viewer window on a pdf file and the process gets stuck.