ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sat, 27 May 2017 01:23:03 +0200Can't Install R Packages in Sagehttps://ask.sagemath.org/question/10023/cant-install-r-packages-in-sage/I'm running Sage 5.8 on Ubuntu 12.10 and am trying to install some R packages within Sage. However, when I enter
%r
install.packages("deSolve")
I get a green line and nothing happens. I am not asked what repository I'd like to use; when I specified a repository, I still got a green line and nothing happened. If I leave out the package name, I get a pop-up asking what package I want to install but nothing after that. What should I do?
Sun, 14 Apr 2013 20:28:46 +0200https://ask.sagemath.org/question/10023/cant-install-r-packages-in-sage/Comment by kcrisman for <p>I'm running Sage 5.8 on Ubuntu 12.10 and am trying to install some R packages within Sage. However, when I enter</p>
<pre><code>%r
install.packages("deSolve")
</code></pre>
<p>I get a green line and nothing happens. I am not asked what repository I'd like to use; when I specified a repository, I still got a green line and nothing happened. If I leave out the package name, I get a pop-up asking what package I want to install but nothing after that. What should I do?</p>
https://ask.sagemath.org/question/10023/cant-install-r-packages-in-sage/?comment=17904#post-id-17904Ordinarily this should work fine - I've done it live in talks. Did you download a binary or build from source? Any other information about your install would be very helpful.Sun, 14 Apr 2013 23:14:08 +0200https://ask.sagemath.org/question/10023/cant-install-r-packages-in-sage/?comment=17904#post-id-17904Answer by JoalHeagney for <p>I'm running Sage 5.8 on Ubuntu 12.10 and am trying to install some R packages within Sage. However, when I enter</p>
<pre><code>%r
install.packages("deSolve")
</code></pre>
<p>I get a green line and nothing happens. I am not asked what repository I'd like to use; when I specified a repository, I still got a green line and nothing happened. If I leave out the package name, I get a pop-up asking what package I want to install but nothing after that. What should I do?</p>
https://ask.sagemath.org/question/10023/cant-install-r-packages-in-sage/?answer=15452#post-id-15452I had these issues when first using the binary versions of sagemath. Installing wouldn't work, and the "include directories are empty" message would pop up in sage -R.
Solved it by using the command:
sage -fr
to force-rebuild the R package. Make sure you have all the build dependencies for libpng, libjpeg, cairo, etc. installed.
Then I could use install.packages("...") from sage -R, the notebook in R mode, or %r-cell mode with no issues.
Now I use a source build/updated version of sage instead.Sun, 15 Sep 2013 02:37:09 +0200https://ask.sagemath.org/question/10023/cant-install-r-packages-in-sage/?answer=15452#post-id-15452Comment by JoalHeagney for <p>I had these issues when first using the binary versions of sagemath. Installing wouldn't work, and the "include directories are empty" message would pop up in sage -R.</p>
<p>Solved it by using the command:
sage -fr
to force-rebuild the R package. Make sure you have all the build dependencies for libpng, libjpeg, cairo, etc. installed.</p>
<p>Then I could use install.packages("...") from sage -R, the notebook in R mode, or %r-cell mode with no issues.</p>
<p>Now I use a source build/updated version of sage instead.</p>
https://ask.sagemath.org/question/10023/cant-install-r-packages-in-sage/?comment=37713#post-id-37713I've also found recently that with sage version 7.6, install.packages won't work unless I specifically set method='wget'. This is using a http mirror, but I don't know if that has anything to do with it.
E.g.
install.packages('automap',method='wget')
Otherwise it complains that it doesn't have a version of that package for the version of R included with sagemath.
E.g.
package â€˜automap' is not available (for R version 3.2.4 Revised)Sat, 27 May 2017 01:23:03 +0200https://ask.sagemath.org/question/10023/cant-install-r-packages-in-sage/?comment=37713#post-id-37713Comment by kcrisman for <p>I had these issues when first using the binary versions of sagemath. Installing wouldn't work, and the "include directories are empty" message would pop up in sage -R.</p>
<p>Solved it by using the command:
sage -fr
to force-rebuild the R package. Make sure you have all the build dependencies for libpng, libjpeg, cairo, etc. installed.</p>
<p>Then I could use install.packages("...") from sage -R, the notebook in R mode, or %r-cell mode with no issues.</p>
<p>Now I use a source build/updated version of sage instead.</p>
https://ask.sagemath.org/question/10023/cant-install-r-packages-in-sage/?comment=17010#post-id-17010Good catch - sometimes it's not clear whether users are using a binary or Sage built from source!Mon, 16 Sep 2013 09:47:48 +0200https://ask.sagemath.org/question/10023/cant-install-r-packages-in-sage/?comment=17010#post-id-17010Answer by slelievre for <p>I'm running Sage 5.8 on Ubuntu 12.10 and am trying to install some R packages within Sage. However, when I enter</p>
<pre><code>%r
install.packages("deSolve")
</code></pre>
<p>I get a green line and nothing happens. I am not asked what repository I'd like to use; when I specified a repository, I still got a green line and nothing happened. If I leave out the package name, I get a pop-up asking what package I want to install but nothing after that. What should I do?</p>
https://ask.sagemath.org/question/10023/cant-install-r-packages-in-sage/?answer=14779#post-id-14779Launch R instead of Sage, by using the following command in a terminal window.
$ sage -R
You can then install the R packages. Once installed, you can use them in Sage.Sun, 14 Apr 2013 20:36:04 +0200https://ask.sagemath.org/question/10023/cant-install-r-packages-in-sage/?answer=14779#post-id-14779Comment by jaia for <p>Launch R instead of Sage, by using the following command in a terminal window.</p>
<pre><code>$ sage -R
</code></pre>
<p>You can then install the R packages. Once installed, you can use them in Sage.</p>
https://ask.sagemath.org/question/10023/cant-install-r-packages-in-sage/?comment=17905#post-id-17905That partly works, but now I get warnings about the R include directory being empty and then an error that says compilation failed.Sun, 14 Apr 2013 20:44:54 +0200https://ask.sagemath.org/question/10023/cant-install-r-packages-in-sage/?comment=17905#post-id-17905Comment by kcrisman for <p>Launch R instead of Sage, by using the following command in a terminal window.</p>
<pre><code>$ sage -R
</code></pre>
<p>You can then install the R packages. Once installed, you can use them in Sage.</p>
https://ask.sagemath.org/question/10023/cant-install-r-packages-in-sage/?comment=17882#post-id-17882@jaia: Did you have bad hardcoded paths before, or was there some other problem? We would love to add you to the reviewer list at http://trac.sagemath.org/sage_trac/ticket/9668 if this solved the problem based on what that package was for!Tue, 16 Apr 2013 14:48:07 +0200https://ask.sagemath.org/question/10023/cant-install-r-packages-in-sage/?comment=17882#post-id-17882Comment by jaia for <p>Launch R instead of Sage, by using the following command in a terminal window.</p>
<pre><code>$ sage -R
</code></pre>
<p>You can then install the R packages. Once installed, you can use them in Sage.</p>
https://ask.sagemath.org/question/10023/cant-install-r-packages-in-sage/?comment=17903#post-id-17903OK, solved it. I installed the new spkg at http://boxen.math.washington.edu/home/palmieri/SPKG/r-2.15.2.p2.spkg. (For anyone who doesn't know how to do this, in Ubuntu I ran sudo sage -i http://boxen.math.washington.edu/home/palmieri/SPKG/r-2.15.2.p2.spkg .)Sun, 14 Apr 2013 23:15:46 +0200https://ask.sagemath.org/question/10023/cant-install-r-packages-in-sage/?comment=17903#post-id-17903