--- the all-in-one editor for data analysis
and easy creation of LaTeX based documents with R
-> relax icon:
-> How to work with
relax? -- writing reports
-> Other uses of
-- modifying your computations, data sets, interactive papers for presentation,
-> Technical remarks
relaxis designed for statisticians allowing them to write statistical reports without switching between text processing and R.
relax creates a window with a report field.
The report field enables you to enter R expressions
as well as pieces of text to document your ideas.
Computations and plots can be included quickly.
After finishing your work the sequence of text chunks, code chunks and
integrated graphics and/or R-output will constitute the basis of your work.
To achieve a higher quality relax integrates LaTeX compilation for
professional formatting and pretty printing.
Reports and other papers written according to the rules of
(even without prior use of this editor)
can be opened with
Rwined?s striking feature is the possibility to easily modify your
R-analysis in your already written report:
Undo all your computations or modify only details,
merges R-output and text or graphics for checking or presentation matters.
You can also select and modify only few expressions and apply them to new data sets
-- and so create one document to be used on several different occasions --
fast and efficient.
relax is based on the literate programming concept
proposed by D.E. Knuth and the noweb system written by Norman Ramsey -- see:
literate programming, literate programming,
Donald E. Knuth,
Here you find a poster describing relax. Here is a snapshot: ...
relaxyou activate the editor by loading the package
relaxand starting the R function
relax() creates a new window consisting of two text fields and
some buttons and menus.
The upper text field is the report field. Here you type in R expressions and the necassary annotations and remarks for properly documenting your argumentation. The lower field is the output field. It shows the results of R?s computations.
relax understand that R commands are used
and some calculations are to be integrated into the document
we need an introductory expression, let?s call ot code chunk.
It has a header line like
"‹‹*››=" or "‹‹nice name
for the following code››=".
A code chunk is automatically completed by the following text chunk.
As you can see, using
relax?s syntax is simple.
All you need are two rules with text chunks and code chunks:
"@" defines the start of a text chunk whereas
"‹‹...››" shows the beginning of a code chunk.
Here is a simple example:
EvalRCode" (or Alt+E).
relaxwill extract the code and R will try to run it. Results are shown in the lower text field of
relax(output field -- in a beach-like color).
Insertthe contents of the output field are moved to the report field.
postscriptcopy and a
jpegcopy of the current graphics device and inserts LaTeX /
htmlcommands in order to include the graphics file for further printing in LaTeX.
TrashROutput" and "
RemoveOutclears the output field.
TrashROutputdeletes the inserted R output of the report field the mouse is pointing at.
This way you can perform step by step your analysis:
Writing text chunks, writing code chunks and inserting results.
PlanRCode" creates an empty text chunk and an empty code chunk
to make your work easier.
File-menu you are asked to choose a file name. Then
relaxwill generate two files: a file with extension
.revand a "html" file. The second file can be viewed by a browser.
Friends of LaTeX prefer LaTeX for formatting. To generate a
the source file ("
.rev"-file) you have to "weave" it.
Weaving is initiated by selecting
of the Wizardry
.tex version of the report contains a correct preamble,
LaTeX will format it as usually.
By the way the menu
Wizardry has an item
Wizardry->LaTeX.head to insert a simple preamble into the report.
LaTeX can be invoked by
but you do not get any LaTeX error messages.
Therefore it is recommended to normally compile the generated .tex file
from your local LaTeX source.
Proceed with the "
.dvi"-file as usual.
example report file: pdf format
relaxmost effectively -- gaining expertise fast
.rev"-file. Repeat the steps of the data analysis of your report. Interactively check the results through
relax. Integrate new ideas -- modify the code chunks or append new expressions to enhance the analysis!
.rev"-file containing your basic ideas or simply use a similar .rev file from the past that just needs to be modified, 2. assign a data set to the "formal" variable of the code chunks, 3. evaluate the code chunks (
.revfile. Load the source file, select the code chunks you need and simply evaluate them as a part of your discussion. This is an easy an impressive way to keep people interested and in touch with the subject. Comments or critics can be "felt and seen" without delay by modifying or extending the code spontaneously. Code chunks with name "
start" (code chunk header: ‹‹start››=) will be evaluated at startup
relax. This enables you to save the definitions of your own programmed functions in an appendix in "
start" code chunks and you can use these at once in the first code chunk of the "
Remark: strings in text chunks that are bracketed by
[[...]] will be formatted as code.
Sweaveis based on the noweb system. Consequently, you can construct an
relaxis written in R and
Tcl/Ttk. To make it work the package
relaxneeds to be installed in R. Some local configuration settings are found in the file "your-R-library
relax checks your report in an environment named
revive.env". If this variable is not found the environment
is generated. Otherwise it is used to evalute the code chunks.
relax you can have a look at "
revive.env" and change the objects of "
revive.env" by hand.
The internal variables of
relax are stored in a second environment.
It can be found via "
revive.sys" stored in environment "revive.env".
New Features of Version 1.02
contains the newest installed version of
.zip file has to be extracted into your local R library --
Some configuration settings are stored in
Feel free to play around with the settings,
but don't cry when
doesn't work properly anymore.
contain the newest versions of
.gz file has to be installed by
R CMD INSTALL
To be able to show copies of R-plots in the report field the "
Img" package for
Tcl/Tk needs to be installed. This is no problem with the windows versions of
Linux users have to install "
and have to manually correct the path in the assignment
relax_1.00.zip (R-2.1.0, R-2.2.0)
relax_1.00.tar.gz (R-2.1.0, R-2.2.0)
relaxand relax -- P. Wolf, M. Hempelmann
relax is free software; you can redistribute it and/or modify it under the terms of
the GNU General Public License as published by the Free Software Foundation; either version 2,
or (at your option) any later version.
relax is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
A copy of the GNU General Public License is available via WWW at