| relax {relax} | R Documentation |
relax is an editor for doing data analysis with R and writing reports.
relax(file.name, no.plots = FALSE, cmds = "", but.Wizardry = TRUE)
file.name |
name of report file to be loaded |
no.plots |
if TRUE no plots are integrated into the report text field |
cmds |
special operations that are evaluated on start |
but.Wizardry |
if FALSE menu Wizardry is not created |
relax is written in R and Tcl/Tk.
relax creates a new window (top level Tcl/Tk widget) that consists of
two text fields and some buttons and menus. Text (chunks) and code (chunks)
are inserted in the upper text field (report field). Code chunks are evaluated by clicking
on EvalRCode. Results are shown in the lower text field (output field) and will be
transfered to the report field by pressing on Insert.
Chunks are separated by separators:
A line containing the character "@" at its first position indicades the beginning of a text chunk.
Patterns like <<*>>= or <<code chunk name>>= define code chunk
headers and introduce code chunks.
The code of a code chunk is the set of R expression found between the header and the
following text chunk.
How to work with relax?
relaxR through: library(relax).relax().PlanRCode and an empty text chunk and an empty code
chunk without contents appear in the report field (upper blue text field).
Now you can write down any text between
"@"-line and the header of next code chunk <<*>>=. The code has to be placed
after the header line.EvalRCode evaluates the code (the cursor is pointing at)
and the results appear in the output field just as in R;
warnings will be converted in errors and will stop the evaluation.WarnEval evaluates the code (the cursor is pointing at)
and the results appear in the output field just as in R;
however warnings will not stop the evaluation of the code.RemoveOut clears the output field.Insert transfers the contents of the output text field
to the upper text field as a new text chunk.SavePlot copies the graphics device; it creates a postscript
as well as a jpeg file and inserts the LaTeX includegraphics reference
in the report field as a new text chunk.Find finds some text string in the working text and highlights
matches found.TrashOutput removes inserted R output from the upper field
(the cursor is pointing at). Down moves the cursor down to the next code chunk.Up moves the cursor up to the next code chunk.File menu in the menu bar of relax allows you save the report
– the contents of the blue text field. The saving operation generates two
files: a text file (extension: rev) and a html file.
You can load an old report into the upper text field (report field)
and continue to work on the report.Edit menu:
searching, starting an external editor, etc.Options menu change some of the parameter of relax.Wizardry you are able to generate LaTeX documents
(for LaTeXperts only).
After saving the raw report you can web it: this process generates a tex-file
that can be formated by LaTeX. See your LaTeX companion for syntax.
(The web syntax fits to the rules of noweb.
Therefore, the raw files can also be processed by Norman Ramsey's
noweb system (see: relax can be modified in ...relax/config/settings.relax.revive.env).cmds in environment (revive.env) enables you to
define operations of your own. For example, cmds<-"r test1.rev" forces relax
to load file test1.rev. cmds<-c("> 1+1","> 2+2") results in
computing 1+1 and then 2+2. cmds<-"s10" evaluates code chunk number 10.–
Img for showing jpeg pictures in the text window.
If this package isn't found relax will print a warning message.
For further information about the package see:
http://sourceforge.net/projects/tkimg,
http://members.chello.nl/~j.nijtmans/img.html, and
http://home.kpnplanet.nl/~J.Nijtmans@kpnplanet.nl/img.html.
The Img package has to be installed by the user himself.
Windows users can proceed as follows:Img is to install ActiveTcl8.4.19
of ActiveState which you get via
http://www.activestate.com/Products/activetcl/index.mhtml.
The Tcl/Tk-package "Img" is included in the tcl distribution of ActiveState.
It is important to use version Tcl8.4 and not Tcl8.5!
The following four steps will hopefully result in a working installation:
Tcl8.4 from ActiveState. May be the name of the
downloaded file is ActiveTcl8.4.19.286921-win32-ix86-threaded.exe.lib of Tcl8.4 in the relax configuration file.
The configuration of relax is modified by activating the
entry Configure Relax: view or change parameters of relax of the
relax menu Options.
In the configuration file you have to search the line with the entry
# imgpath.sys <- "C:/Tcl/lib". Then remove the comment character in front of
imgpath.sys and insert the correct path to the Tcl/Tk lib directory.
The modified line may look like this: imgpath.sys <- "C:/Tcl/lib".relax again.Hans Peter Wolf
http://www.wiwi.uni-bielefeld.de/statistik/mitarbeiter/wolf/software/relax.html
## The function is currently defined as
function (workname.sys = "out.rev", no.plots = FALSE, cmds = "", but.Wizardry = TRUE){
# nearly 5000 lines of R / Tcl/Tk code
}