Alice Broadhead
Alice Broadhead

Reputation: 95

saving R GUI preferences as default

I am trying to save my GUI preferences and have them used as the default when I open R. I'm using R 3.0.1, the 64-bit version in Windows.

I went to 'edit' then 'GUI preferences...' and changed them. I chose the 'save' button, and saved the GUI preferences file as 'Rconfig' to the /etc file where the programs are stored.

Unfortunately, this Rconfig is not the default file that R is using for the GUI preferences. Every time I open R, I have go to the 'GUI preferences...' menu and reopen my 'Rconfig' file.

What else do I need to do to have my saved GUI settings open as default?

Upvotes: 7

Views: 5250

Answers (2)

tonyotag
tonyotag

Reputation: 1

The procedure I am about to discuss does not answer the question fully; it does provide clues. I also do not like the initial GUI screen but ok to load what I like. I searched via clues and found section 5.2 of Rgui help > FAQ on R in Windows. Especially when I ran ?Rconsole and searched R Documentation

In any case, here are some steps I follow when I start a new R GUI preference ::

  • I save a file per the Rgui Edit > GUI Preferences.
  • A window opens for changing the GUI preferences and I save a file of what I like.
  • I place the file where I know I can save or transfer it later (save to USB, etc...)
  • I run these two lines (really it is more like one line.)

x <- [file pathway in R readable format in quotes; example: "C:\Users\....\[filename]"]

loadRconsole(x) #works has warning message pop up alert window as if it was changed in the GUI Preferences window. must be part of the function and the same function used in the GUI Preferences interface.

I run two lines because I check the file variable to make sure the file is readable.

for reference check CRAN library:

check R Documentation... found it: is part of Rwin configuration {utils} function sets of the utils package: loadRconsole(file) http://127.0.0.1:25959/library/utils/html/Rconsole.html

Upvotes: 0

eddi
eddi

Reputation: 49448

As ?Rconsole points out:

There are system copies of these files in ‘R_HOME\etc’. Users can have personal copies of the files: these are looked for in the location given by the environment variable R_USER. The system files are read only if a corresponding personal file is not found.

If the environment variable R_USER is not set, the R system sets it to HOME if that is set (stripping any trailing slash), otherwise to the Windows ‘personal’ directory, otherwise to {HOMEDRIVE}{HOMEPATH} if HOMEDRIVE and HOMEDRIVE are both set otherwise to the working directory. This is as described in the file ‘rw-FAQ’.

So start by checking e.g. what Sys.getenv("R_USER") is set to and check for an "Rconsole" file there and keep going until you find the offending file.

Upvotes: 8

Related Questions