Requesting R and Octave Packages

55 views
Skip to first unread message

Elimboto Yohana

unread,
Mar 20, 2021, 6:12:22 AM3/20/21
to sage-cell
Hi Andrey,

I have been testing R and Octave with SageCell. I think it is worth installing these R libraries shall that be possible:


3. Is it possible to install the swirl package with its associated courses?

Install swirl package:
install.packages("swirl")

Install courses:
library("swirl")
install_course("Course Name")


Instructions on how to install courses are described at https://github.com/swirldev/swirl_courses

It would however be great to install these Octave Packages:

1. statistics
2. econometrics

I tried to check if they are installed by loading them,

pkg load statistics                
pkg load econometrics

but the server executes for a long time without any response.

Kind regards,

Elimboto



Andrey Novoseltsev

unread,
Apr 1, 2021, 1:11:35 PM4/1/21
to sage-cell
Hi Elimboto,

octave-statistics was installed before, I've also installed octave-econometrics, can you please test again?

For R - do you know how to install packages without any user interaction? As long as we are using R shipped with Sage, I can't directly use system ones. It seems there are now options to use a system one instead, but I didn't look into it closely, there were more pressing issues ;-)

Elimboto Yohana

unread,
Apr 1, 2021, 5:42:22 PM4/1/21
to Andrey Novoseltsev, sage-cell
Hi Andrey,

Thank you very much, both Octave packages are working fine.

As for R packages, I'm not sure if what you asked may be close to what is being discussed here! https://stackoverflow.com/questions/51510644/how-to-not-need-user-input-for-install-packagestype-both

Kind regards,

Elimboto

--
You received this message because you are subscribed to the Google Groups "sage-cell" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-cell+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-cell/d80253c2-626e-4e9e-8103-33abf9042047n%40googlegroups.com.

Andrey Novoseltsev

unread,
Apr 5, 2021, 5:41:11 PM4/5/21
to sage-cell
Hi Elimboto,

I've installed these packages and they work to some extent https://sagecell.sagemath.org/?q=dvvfai

I am unclear however, what do you expect from swirl, given that it tries to work interactively.

On a related note - have you tried to setup SageMathCell for yourself just so that you can experiment with it and its capabilities, including what happens with extra packages install in the system or Sage itself?

Best,
Andrey

Andrey Novoseltsev

unread,
Apr 6, 2021, 1:32:55 PM4/6/21
to Elimboto Yohana, sage-cell
On Tue, Apr 6, 2021 at 4:17 AM Elimboto Yohana <e...@tssfl.com> wrote:
Thank you for installing deSolve and ggplot2. Why I'm I encountering the runtime error?

RRuntimeError: Error in library(ggplot2) : there is no package called ‘ggplot2’

RRuntimeError: Error in library(deSolve) : there is no package called ‘deSolve’


No idea - it works fine for me on your site as well. Can you give detailed steps to reproduce the error? 

Elimboto Yohana

unread,
Apr 7, 2021, 1:22:51 AM4/7/21
to Andrey Novoseltsev, sage-cell
Hi Andrey,

This has been inconsistent, sometimes it works, sometimes not. I have been getting such an error by just importing the library only: library(ggplot2), library(deSolve). It is somehow stable currently.

Kind regards,

Elimboto


--
You received this message because you are subscribed to the Google Groups "sage-cell" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-cell+...@googlegroups.com.

Elimboto Yohana

unread,
Apr 7, 2021, 4:37:42 PM4/7/21
to Andrey Novoseltsev, sage-cell
This error keeps coming up. library(ggplot2) yields the following error message (similarly for other R packages, e.g., deSolve):

---------------------------------------------------------------------------
RRuntimeError                             Traceback (most recent call last)
<ipython-input-1-0c929c793351> in <module>
----> 1 r.eval("options(bitmapType='cairo')"); print(r.eval("""library(ggplot2)""").strip())
      2 r.eval("graphics.off()"); None

/home/sc_serv/sage/local/lib/python3.8/site-packages/sage/interfaces/r.py in eval(self, code, *args, **kwds)
   1337         """
   1338         self._lazy_init()
-> 1339         return str(robjects.r(code)).rstrip()
   1340 
   1341 

/home/sc_serv/sage/local/lib/python3.8/site-packages/rpy2/robjects/__init__.py in __call__(self, string)
    414     def __call__(self, string):
    415         p = rinterface.parse(string)
--> 416         res = self.eval(p)
    417         return conversion.rpy2py(res)
    418 

/home/sc_serv/sage/local/lib/python3.8/site-packages/rpy2/robjects/functions.py in __call__(self, *args, **kwargs)
    195                 v = kwargs.pop(k)
    196                 kwargs[r_k] = v
--> 197         return (super(SignatureTranslatedFunction, self)
    198                 .__call__(*args, **kwargs))
    199 

/home/sc_serv/sage/local/lib/python3.8/site-packages/rpy2/robjects/functions.py in __call__(self, *args, **kwargs)
    123             else:
    124                 new_kwargs[k] = conversion.py2rpy(v)
--> 125         res = super(Function, self).__call__(*new_args, **new_kwargs)
    126         res = conversion.rpy2py(res)
    127         return res

/home/sc_serv/sage/local/lib/python3.8/site-packages/rpy2/rinterface_lib/conversion.py in _(*args, **kwargs)
     42 def _cdata_res_to_rinterface(function):
     43     def _(*args, **kwargs):
---> 44         cdata = function(*args, **kwargs)
     45         # TODO: test cdata is of the expected CType
     46         return _cdata_to_rinterface(cdata)

/home/sc_serv/sage/local/lib/python3.8/site-packages/rpy2/rinterface.py in __call__(self, *args, **kwargs)
    622                     error_occured))
    623             if error_occured[0]:
--> 624                 raise embedded.RRuntimeError(_rinterface._geterrmessage())
    625         return res
    626 

RRuntimeError: Error in library(ggplot2) : there is no package called ‘ggplot2’


What is wrong?

Kind regards,
Elimboto

Andrey Novoseltsev

unread,
Apr 19, 2021, 4:14:24 PM4/19/21
to Elimboto Yohana, sage-cell
Hi Elimboto,

Turns out one of the servers didn't install these packages, thank you for your persistent complaints, should be working now!

Andrey

Elimboto Yohana

unread,
Apr 20, 2021, 8:34:51 AM4/20/21
to Andrey Novoseltsev, sage-cell
Hi Andrey,

Thank you for solving an issue. Tested and libraries seem to be working consistently.

Kind regards,

Elimboto

Angel Serrano

unread,
Aug 25, 2021, 5:43:19 PM8/25/21
to sage-cell
Hi! we`re using a sagecell embeded on a moodle course, but we need to use a package called "survey", is there any way to install it? 

Elimboto Yohana

unread,
May 31, 2022, 2:02:55 PM5/31/22
to Angel Serrano, sage-cell
Yes, a number of R packages that were previously  installed not available.

Elimboto

Elimboto Yohana

unread,
Jul 18, 2022, 10:23:42 PM7/18/22
to sage-cell
Hi Andrey,

I would appreciate if you could install the R package 'deSolve", it is missing, but was previously installed:

RRuntimeError: Error in library(deSolve) : there is no package called ‘deSolve’

Kind regards,

Elimboto

Andrey Novoseltsev

unread,
Jul 19, 2022, 1:09:23 PM7/19/22
to sage-cell
Perhaps R packages didn't get installed after the last update again for some reason, although it has been a while. I won't do anything right now as I will be away from computers for a few days, but will look into it when I am back.

Andrey Novoseltsev

unread,
Jul 27, 2022, 1:06:27 AM7/27/22
to sage-cell
Seems to work now and I have added some code to check that R packages are actually installed, hopefully it will prevent reoccurrences of this issue.

Elimboto Yohana

unread,
Jul 27, 2022, 3:24:40 AM7/27/22
to Andrey Novoseltsev, sage-cell
Hi Andrey,

Thanks. Packages seem to work.

Elimboto

On Wed, Jul 27, 2022 at 8:06 AM Andrey Novoseltsev <novo...@gmail.com> wrote:
Seems to work now and I have added some code to check that R packages are actually installed, hopefully it will prevent reoccurrences of this issue.

--
You received this message because you are subscribed to the Google Groups "sage-cell" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-cell+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages