[R] Sage and R (was: Mathematica and R)

Karl-Dieter Crisman kcrisman at gmail.com
Fri Jul 16 21:49:56 CEST 2010


Dear David,

> I managed to install Sage on Windows (via a Linux VM), but I cannot find any documentation on how to use R from Sage. Maybe I
> should use the web interface of Sage to avoid having to install R on the VM.

In the Sage command line, you can type

sage: r?

to get some very basic info, and

sage: r.[tab]

to get various commands.  This part of the interface still needs some
work, though it suffices (particularly via r.eval()) for many needs.
You do NOT need to reinstall R; a full copy of R (with all recommended
packages) is in any recent Sage.

However, based on your earlier emails in the thread, you may want to
start Sage, and then type

sage: notebook()

to launch the web server on your own computer, from which you can get
a Mma-style worksheet and do all R computations in there, by simply
selecting 'r' from the drop-down menu at the top which would currently
read 'sage', or by typing %r at the beginning of each cell you want to
use R in.

You are, however, right that there is very little easy-to-find
documentation on how to use R within Sage, and we VERY much welcome
improvements on this front.  The worksheets
http://prep.sagenb.org/home/pub/34/ and
http://sagenb.org/home/pub/2232/ might have a few tidbits for you, and
the thread at http://groups.google.com/group/sage-support/browse_thread/thread/b8411dfebdb54406/0bca74c09bd4145a?lnk=gst&q=r+integration#0bca74c09bd4145a
may as well.

In particular, if anyone wants to help improve this (though again,
quite a bit already works seamlessly), you may be interested in the
following talk (mine) at useR! 2010 next week:
http://user2010.org/abstracts/Crisman.pdf

We definitely need experts, and also really crave feedback on how Sage
can best be of use to the R community (why R is useful to Sage should
be obvious).

Karl-Dieter Crisman



More information about the R-help mailing list