3

I'm taking a course in R and I've hit a road block on day one.

Typing:

demo(graphics)

...should start a series of graphs being displayed on screen. On my Windows 10 (64 bit) new Dell laptop, I get a persistent error:

Resulting Error in red

The execution is stopped after the red lines, seemingly because the demo(graphics) call is being made with incompatible parameters. In blue I make the same call but use the default function and an empty plot is displayed.

I have tried uninstalling and reinstalling everything, installing through Anaconda and from the CRAN website. The same error persists. I've even tried with mro instead of basic R.

I don't see any similar error messages in my class or on Google. My guess is that I need to install a particular version of R and RStudio make it work but I'm guessing.

Can anybody offer some expertise?

I'm running R version 3.6.1 (2019-07-05) (which is executing code correct, just not the demo call) and RStudio VersionRStudio Version

9
  • Try running R without RStudio and see if it works. Go to the Start menu, type "rgui" and click on the app that appears
    – Hong Ooi
    Dec 2, 2019 at 15:43
  • The same thing but if I manually input plot.default is plots something, though it looks like a different dataset. Dec 2, 2019 at 15:52
  • 1
    stackoverflow.com/questions/46231402/… Maybe this has something to do with it? Dec 2, 2019 at 21:09
  • can you update your rstudio version to 1.2.1335 (or higher if available)
    – Mike
    Dec 4, 2019 at 18:34
  • 2
    Try running a vanilla version of R. To do that ensure that Rgui.exe is on the Windows PATH and then from the Windows cmd line run Rgui --vanilla and try the code again. If that fixes it then it's a problem with your .Rprofile file. Dec 7, 2019 at 22:25

1 Answer 1

0

Running the basic Rgui software from the command line with the --vanilla parameter like so:

Rgui --vanilla

Opened Rgui and the

demo(graphics)

...call worked.

This meant that the issue was in the .Rprofile file. This is found in the etc folder of the basic R installation and when I checked, it looked absolutely fine (entirely commented out actually).

I wanted to use RStudio though, so I investigated the RStudio docs and saw that each project is given its own .Rprofile style initialization file when a new project is created.

So I created a new project with RStudio and by creating a new project whatever configuration issue was causing the error was completely fixed.

Credits to G. Grothendieck for the answer in the comments.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.