Commander()
Rcmdr
dialogs (those in the Statistics -> Fit models menu)
produce linear, generalized
linear, or other models. When a model is fit, it becomes the active model, as indicated in the information
field in the R Commander toolbar.
Items in the Models menu apply to the active model. Initially, there is no active model.
If there are several models in memory, you can select the active model from among them.
If command logging in turned on, R commands that are generated from the menus and dialog boxes are
entered into the script window in the Commander. You can edit these commands in the normal
manner and can also type new commands into the script window. Individual commands
can be continued over more than one line, the several lines of a multi-line command
must be submitted simultaneously. (It is not necessary, as in earlier versions of the
R Commander, to begin continuation lines with white space.) The contents of the script
window can be saved during or at the end of the session, and a saved script can be loaded into the
script window. The contents of the output window can also be edited or saved to a text file.
To re-execute a command or set of commands, select the lines to be executed using
the mouse and press the Submit button at the right of the toolbar
(or Control-R, for "run", or Control-Tab). If no text is selected,
the Submit button (or Control-R or Control-Tab)
submits the line containing the text-insertion cursor. Note that an error will be generated if the submitted
command or commands are incomplete.
Pressing Control-F brings up a find-text dialog box (which can also be accessed via
Edit -> Find) to search for text in the script window or the output window. Edit functions such as
search are performed in the script window unless you first click in the output window to make it the active
window.
Pressing Control-S will save the script or output window.
Pressing Control-A selects all of the text in the script or output window.
In addition, the following Control-key combinations work in the script and output windows: Control-X, cut;
Control-C, copy; Control-V, insert; Control-Z, undo; and Control-W, redo.
Right-clicking the mouse (clicking button 3 on a three-button mouse) in the script or output window brings up
a "context" menu with the Edit-menu items, plus (in the script window) a Submit item.
When you
execute commands from the Commander window, you must ensure that the sequence of commands
is logical. For example, it makes no sense to fit a statistical model to a data set that has
not been read into memory.
Pressing a letter key (e.g., "a") in a list box will scroll the list box to bring the next entry
starting with that letter to the top of the box.
Exit from the Commander via the File -> Exit menu or by closing the Commander window.
Customization and Configuration
The preferred way of customizing the R Commander is to write a plug-in package:
see help("Plugins")
.
Alternatively, configuration files reside in the etc
subdirectory of the package,
or in the locations given by the etc
and etcMenus
options (see below).
The Rcmdr
menus can be customized by editing the file Rcmdr-menus.txt
.
You can add R code to the package, e.g., for creating additional dialogs, by placing files with
file type .R
in the etc
directory, also editing Rcmdr-menus.txt
to provide
additional menus, sub-menus, or menu-items. Alternatively, you can edit
the source package and recompile it.
To reiterate, however, the preferred procedure is to write an R Commander plug-in package.
A number of functions are provided to assist in writing dialogs, and Rcmdr
state information
is stored in a separate environment. See help("Rcmdr.Utilities")
and the manual supplied in the doc
directory of the Rcmdr
package for more information.
In addition, several features are controlled by run-time options, set via the options("Rcmdr")
command. These options should be set before the package is loaded. If the options are unset, which is
the usual situation, defaults are used. Specify options as a list of name=value pairs. You can
set none, one, several, or all options. The available options are as follows:
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Some options can also be set via the File -> Options menu, which will restart the Commander after options are set.
If you want always to launch the R Commander when R starts up, you can include the following code in one of R's start-up
files (e.g., in the Rprofile.site
file in R's etc
subdirectory):
local({
old <- getOption("defaultPackages")
options(defaultPackages = c(old, "Rcmdr"))
})
R Commander options can also be permanently set in the same manner.
For more information about R initialization, see ?Startup
.options(Rcmdr=list(log.font.size=12, default.contrasts=c("contr.Sum", "contr.poly")))
Run the code above in your browser using DataLab