c:\Program Files\R\R-2.7.2
where "R-2.7.2
"
may vary, according to the version of R that you have installed.
c:\Program Files\R\R-2.7.2\bin\Rgui.exe
. A windows
"shortcut" should have been created on the desktop and/or in the
start menu.
The R graphical user interface (GUI) will open, containing a
single window called the command or console window.
The
greater-than sign ( >
) is R's "prompt;" it indicates
that R is ready for you to enter commands.
?read.table
or
help(read.table)
to get help on the function
read.table
.
If you first type options(htmlhelp=TRUE)
,
the above commands will open the html version of the help
files.
help.search("read")
or
apropos("read")
to search for things in R
related to the word "read."
Alternatively, go to the menu bar:
Help:Apropos
q()
at the command prompt.
In each case, you will be asked, "Save workspace image?" Click "Yes" to save your work, "No" to discard your work, or "Cancel" to return to R.
The following is a subset of the resources available for learning and using R.
For the efficient use of R (on your own computer), it is useful to create a couple of start-up files, in order to set some default options or run some R commands automatically.
The file c:\.Renviron
is used to set certain
environment variables for R. I recommend a file containing the
following line, since, by default, R assumes you want A4 paper.
R_PAPERSIZE=letter
The file c:\.Rprofile
is assumed to contain R code,
which is run at start-up. I recommend including something like the
following (to make use of the html version of the help pages the
default, to turn off the asterices that show up in significance tests).
You may also use this to automatically load an optional package.
options(htmlhelp=TRUE, show.signif.stars=FALSE)
R keeps your "workspace" of objects in a single file
(.RData
), which is read into RAM when R is started and
potentially written to disk at the end of a session. (Note: To
save your workspace without exiting, type save.image()
at
the R prompt. It is good to do this periodically, so that your work
is saved in case that R or your computer crashes.)
One may wish to have multiple R workspaces (i.e.,
.RData
files), one for each project or data set. In
Windows, we do this as follows:
c:\Rwork\Project1
and
c:\Rwork\Project2
).
c:\Rwork\Project1
).
R
Project1
.
After making a plot, select (from the menu bar) History:Recording. After making further plots, you may use the Page Up and Page Dn keys to go back and forth through the previous plots you've made.
Use a text editor (such as Notepad or an enhanced version such as EditPad) to edit a file containing your commands. Use the Windows keyboard shortcut Alt:Tab to quickly switch between R and your text editor.
Note that commands you type in R are saved
(temporarily) in the file .Rhistory
(in the same
directory as your .RData
file). You may wish to
peruse (or copy and paste from) this file and keep a
permanent record your analysis commands.
By default, R for Windows prints no messages while a command is running. I prefer to turn off this "buffered output" feature. Right-click on the "R Console" window and de-select Buffered output.
rm(list=ls())
Last modified: Mon Jun 29 23:50:20 2009 |