Background code running on Rstudio startup

When trying to find an easy way to update all my packages to the new version of R I was running, I foolishly entered this code into my script:

## get packages installed
packs =[1]), stringsAsFactors = F)

## and now re-install install packages using install.packages()

Now, even after removing it from my script and restarting Rstudio countless times, I cannot run any of my code. The code does not appear in the console and there is no >, +, or blinking cursor in the console.

I think I have done something similar before and suspect it is attempting to run that code at every startup. I once found how to edit the startup code in the Rstudio Program Files but it took days of searching forums to find the solution and I can't find it again. Any help would be greatly appreciated.

Edit: Uninstalling and reinstalling RStudio does not solve the problem

The typical place would be the file called .Rprofile (on Windows, in your Documents folder).

An easy way to check:

  1. Open a terminal (cmd on Windows)
  2. Type R and enter, if it's something in the .Rprofile it will be hanging as previously, force close the window
  3. Type R --vanilla and enter, this ignores the .Rprofile, so R should open correctly if that was the problem.

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.