ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 26 May 2017 18:23:03 -0500Can't Install R Packages in Sagehttp://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 13:28:46 -0500http://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>
http://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 16:14:08 -0500http://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>
http://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.Sat, 14 Sep 2013 19:37:09 -0500http://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>
http://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)Fri, 26 May 2017 18:23:03 -0500http://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>
http://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 02:47:48 -0500http://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>
http://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 13:36:04 -0500http://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>
http://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 16:15:46 -0500http://ask.sagemath.org/question/10023/cant-install-r-packages-in-sage/?comment=17903#post-id-17903Comment 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>
http://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 13:44:54 -0500http://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>
http://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 07:48:07 -0500http://ask.sagemath.org/question/10023/cant-install-r-packages-in-sage/?comment=17882#post-id-17882