Skip to content
Prev 447 / 1236 Next

[R-gui] OpenOffice.org and R

Hello,

This is very interesting! I have always resisted to anything that could 
mix R and Microsoft Office, because I believe it is against the Open 
Source phylosophy. Of course, with OpenOffice, no problems!

There are many ways where interaction between R and OpenOffice would be 
a mutual benefit. Usually, the one that come to the mind is to use R as 
a powerful calculation engine for oOOCalc. Indeed, you will find ideas 
in RGnumeric in OmegaHat, and also in RExcel (part of the R(D)Com server).

Other ways where interaction between R and OpenOffice could be interesting:

1) Using oOOCalc as a powerful replacement of the data editor in R: 
function edit(mydataframe) opens the dataframe in oOOCalc and changes 
made are transmitted back to R.

2) Using oOOWriter as a "notebook ? la Mathematica" editor, that is, 
mixing plain text with calculations and graphs interactively generated by R.

3) Using oOOWriter as a report editor (see for instance the reporting 
features in the SciViews bundle on CRAN).

and perhaps:

4) Using oOOWriter as a WYSIWYG help files (.Rd) editor.


Now, regarding the way you make R and oOO collaborate, there are again 
many possibilities. Besides the shared library under Unix, and the 
R.dll, or R(D)Com server in Windows, I think the optimal communication 
would:
- require no changes in R, and no recompilation,
- be bidirectional,
- allow communication with R even when it is busy calculating something 
(in the case you can interact with R both at the command line and with 
the external client simultaneously),
- allow connecting/disconnecting (hot plug) to a running R session that 
was not started initially to interact with your client application,
- work the same way on all supported platforms.

Clearly, solutions proposed in 
http://cran.r-project.org/doc/manuals/R-exts.html#Linking-GUIs-and-other-front_002dends-to-R 
do not match one or several items in this wishlist. Also, all of them 
use R as a server exclusively, that is, you cannot interact with R as 
usual at the command line at the same time you plug it into you client 
(well, you have to program your own console window in the client app to 
get a control of R through command line). Indeed, there are 
circumstances where you would prefer to keep both a direct and indirect 
interaction with R. Options 1, 2 and 4 above  may fall in this category.

With Tom Short (the author of Rpad), we have started exploring the 
possibilities to use sockets by means of Tcl. Tcl (tcltk R package) is 
now widely usable with R, and it is possible to write a very powerful 
socket server with this language. You will find a first implementation 
of it in svSocket package (part of the SciViews bundle), and also a more 
advanced one to exchange HTML data in Rpad. I think this is a promising 
approach because it matches all items in the wishlist: it works the same 
on all platforms; it permits hot plug no mather the way R was started 
(console, Rgui under Windows, Emacs-ESS, ...), etc.

Oh yes, and speaking about it, these is also the ESS mode of R (Emacs) 
that could inspire you another way to embed R in oOO.

Finally, I would say that I am willing to help in your entreprise. If 
you decide to use part or all of the R GUI API I am implementing in the 
SciViews bundle, I can surely help you to use it (documentation is only 
partial for the moment). I can also add, or adapt functions of this API 
to make it more efficient in the context of your developments for oOO.

Best,

Philippe Grosjean

..............................................<?}))><........
  ) ) ) ) )
( ( ( ( (    Prof. Philippe Grosjean
  ) ) ) ) )
( ( ( ( (    Numerical Ecology of Aquatic Systems
  ) ) ) ) )   Mons-Hainaut University, Pentagone (3D08)
( ( ( ( (    Academie Universitaire Wallonie-Bruxelles
  ) ) ) ) )   8, av du Champ de Mars, 7000 Mons, Belgium
( ( ( ( (
  ) ) ) ) )   phone: + 32.65.37.34.97, fax: + 32.65.37.30.54
( ( ( ( (    email: Philippe.Grosjean@umh.ac.be
  ) ) ) ) )
( ( ( ( (    web:   http://www.umh.ac.be/~econum
  ) ) ) ) )          http://www.sciviews.org
( ( ( ( (
..............................................................
Ian Laurenson wrote: