r error 4 (R code execution error) unable to generate plot

Hi Louise! Welcome!

I agree with @pieterjanvc that it would help to have some runnable code that reproduces this problem, but before that: can you check to see if this is an RStudio-specific problem, or something that also happens in R outside of RStudio?

Here's how:

  1. Run the code that you expected to produce your plot in R outside of RStudio. That could be via:

    • Running the default R GUI app that was installed when you installed R (Rgui.exe on Windows, and R.app on macOS)
    • Running R in your terminal
  2. Do you get a plot? Do you see the same errors?

(if all the talk of "R outside RStudio" above made you suddenly feel :dizzy_face:, you might want to take a look at: Differentiating R from RStudio)

1 Like