RStudio Won't Run Any Code?

I am new to RStudio, and up until yesterday was able to run code. I have started a new RMarkdown Project, and it will no longer allow me to run any code. In fact, the normal button has "disappeared".

For example:

  1. I hit "insert a new R Chunk"
  2. A grey box appears in my script for me to write in code.
  3. I insert the desired packages I would like to run

And then nothing... there is no longer the green arrow that used to be there to allow me run in the grey script. In the tool bar there is a button that says Run with a green arrow, and when I select it does not run at all.

This is the same problem if I try a new R chunk with any code.

Any guidance would be appreciated!

This often happens when your code chunk (the ```{r} or the ``` that ends it) is malformed in some way.

As one example (this isn't necessarily your problem), if the chunk ends with only two backticks instead of three, RStudio won't recognize it as a complete chunk (even though it will still be gray), and buttons to run the chunk won't work.

Try making sure that your chunk starts with ```{r} and ends with ```, or try creating a fresh document if you're not sure what's wrong. Otherwise, try sharing a screenshot of your document.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.