I used to have it set up that R commander plug-in would start up automatically every time I opened the R application, but I've upgraded R and can't remember how I did it.
-
3I think the answer is here `?.Rprofile`. – Frank May 01 '13 at 18:20
3 Answers
Here is Scott Hyde's instructions for creating a shortcut to start R commander every time you start R.
- Open up the C:\Program Files\R\R-2.10.1\etc (or similarly named version directory).
Edit the file Rprofile.site and add the following lines. The mylibs variable is a list of packages that you want starting up each time you run Rcmdr. Both lattice and MASS are depencies of Rcmdr and need to be loaded. If you load them this way, they are loaded SILENTLY! defpack = getOption("defaultPackages") mylibs = c("tcltk","car","lattice","MASS","Matrix") if(Sys.getenv("RCMDR") == "TRUE") mylibs = c(mylibs,"Rcmdr") options(defaultPackages = c(defpack,mylibs))
Next, copy the shortcut that is used to run R onto the Desktop. Right click on the file, and select properties Add the following to the end of the "Target:" "C:\Program Files\R\R-2.10.1\bin\Rgui.exe" --sdi RCMDR=TRUE
Notice that the options are OUTSIDE of the quotation marks. Change the name of the shortcut you just made to "Rcmdr" Double click on it, and both R and Rcmdr start!

- 948
- 6
- 5
Recently started using R, and I was testing out the other solution given by @user123943, and it just couldn't seem to work out right. Thought maybe there'd be a simpler solution and tried it and it worked fine. All you need to do is:
Find the Rprofile.site file (it should be in an etc file somewhere inside your R program file) (e.g.: C:\Program Files\R\R-4.1.1\etc)
Edit the file (give yourself permissions to edit if required) by adding in
library(Rcmdr)
at the end of the file.
That's it! Quick and easy solution! If you decide to revert it back all you will need to do is remove the added code at the end of the Rprofile.site file :)
Of course, save the file before opening up R again!
To make R run the R Commander every time it starts up, you can modify your R configuration file to automatically load the Rcmdr package. Here's how you can do it:
Locate your R configuration file. The file is named Rprofile and is typically found in your home directory.
There are two files named Rprofile, don't choose the file of the type "SITE" but the file of the type "file" with the path C:\Program Files\R\R-4.3.0\library\base\R
In windows enter "editor" in the search field at the bottom left and open the text editor app by right clicking "run as administrator". Otherwise changes in Rprofil can't be safed.
Add the following code to the end of the Rprofile file:
Load Rcmdr package
if (!require("Rcmdr")) {
install.packages("Rcmdr", dependencies = TRUE)
library("Rcmdr")
}
This code will check if the Rcmdr package is installed. If it's not, it will automatically install it and load the package.
- Save the Rprofile file.
By modifying the Rprofile file, you ensure that the R Commander is launched every time R starts up. This approach saves you from manually executing the code library(Rcmdr) to load the R Commander in every session.

- 1