Ask Your Question

R interface on Sage

asked 2017-08-29 09:03:55 -0500

Hi, recently I am using the statistics software R. Since R has a reputation of unfriendly user interface, I decide to use the R interface on Sage. I would like to know how to run R on Jupyter notebook and also on Linux Sage.

edit retag flag offensive close merge delete


IMHO R might have an unfriendly interface but "R through Sage" is even uglier!

vdelecroix gravatar imagevdelecroix ( 2017-08-31 10:54:10 -0500 )edit

Vincent is both right and wrong :

  • R has a command-line interface, because it is first and foremost a language (a stats-oriented version of Scheme, with a "nicer" syntax). Its use is not as immediate as a mousodrome such as Excel...
  • Integrating R in Sage allows to use ONE tool for works needing both symbolic and numerical computations, as happens in applied statistics.
  • It is even better when you use Sagetex or a notebook to comment your work : you get ONE document, guaranteed to be consistent : numerical computation is consistent with math, text is consistent with both...

That feature has saved my sorry ass a not inconsiderable number of times...

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2017-09-01 03:01:52 -0500 )edit

2 answers

Sort by ยป oldest newest most voted

answered 2017-09-01 03:14:56 -0500

Emmanuel Charpentier gravatar image

You can add Sage's R kernel to either Sage's Jupyter notebook or a systemwide Jupyter : follow the installation instructions on The Github site for IRKernel.

Note that you may have to play fast'n loose with some symlinks if you want to install this systemwide (Sage doesn't have the permissions to write on the necessary directories for a systemwide install).

Note also that (starting approx. with Sage 7.6, IIRC), a systemwide Jupyter notebook will have trouble finding the $SAGE_ROOT directory : you may have to define this shell variable...

edit flag offensive delete link more

answered 2017-08-29 14:39:12 -0500

eric_g gravatar image

You may have a look at the Interfaces to R section of Sage reference manual.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2017-08-29 09:03:55 -0500

Seen: 92 times

Last updated: Sep 01