I'm running RStudio within Linux Mint. I find that executing a single cell can sometimes take 10 seconds or more the first time around; when the same cell is run a second time, it usually executes immediately.
My system monitor suggests that the issue may lie with Pandoc, as it will take up a decent amount of memory (up to 15-20 GB) and CPU before the code executes. I'm not working with a particularly large dataset: it's only 2,000 rows in length.
Please let me know if there are any potential fixes to this issue that I can try out, as I'm finding myself spending lots of time just waiting for cells to execute. I tried disabling R diagnostics, but that didn't resolve my issue.
I was able to resolve this issue by removing 'output: html_notebook' from the top of my R Markdown notebook. I believe this line was causing pandoc to create a new HTML copy of my notebook whenever I modified and then ran a code cell; this process took quite a while at times. Once I took that line out, RStudio began to run MUCH faster. (This post by Dedalus was crucial in solving this issue.)