Locate the ".Rprofile" file generating default options

In R and RStudio, I think I have messed around with the .Rprofile file a few times, and I currently am loading up an old version of it upon startup of R or RStudio, is there a way that I can quickly find the location of the file that is generating the default options?



Like @Gsee suggested, ?Startup has all you need. Note that there isn't just the user profile file, but also a site profile file you could have messed with. And that both files can be found in multiple locations.

You could run the following to list existing files on your system among those listed on the page:

candidates <- c( Sys.getenv("R_PROFILE"),
                 file.path(Sys.getenv("R_HOME"), "etc", "Rprofile.site"),
                 file.path(getwd(), ".Rprofile") )

Filter(file.exists, candidates)

Note that it should be run on a fresh session, right after your started R, so that getwd() will return the current directory at startup. There is also the tricky possibility that your profile files do modify the current directory at startup, in which case you would have to start a "no-profile" session (run R --no-site-file --no-init-file) before running the code above.

Need Your Help

Setting image src attribute not working in Chrome

jquery google-chrome image

I want to get the src of one image and set it as another's src when #btn is pressed:

managing document.ready event(s) on a large-scale website

javascript jquery maintainability document-ready

NOTE: I have now created a jQuery plugin which is my attempt of a solution to this issue. I am sure that it could be improved and i've probably overlooked lots of use cases, so if anyone wants to g...