1

I am having trouble installing the reshape2 package for R 2.15.3 on Ubuntu 12.04.4 LTS. I decided not to upgrade to R 3.x because many of the packages that I use have not been upgraded to support the new version.

When I try to install reshape2 using R 2.15.3 on Ubuntu 12.04.4 LTS, I get the following.

> install.packages("reshape2")                                                                                      
Installing package(s) into â/usr/local/lib/R/site-libraryâ
(as âlibâ is unspecified)
Warning in install.packages("reshape2") :
  'lib = "/usr/local/lib/R/site-library"' is not writable
Would you like to use a personal library instead?  (y/n) y
Would you like to create a personal library
~/R/x86_64-pc-linux-gnu-library/2.15
to install packages into?  (y/n) y

Warning: dependency âRcppâ is not available
also installing the dependencies âplyrâ, âstringrâ

trying URL 'http://cran.cs.wwu.edu/src/contrib/plyr_1.8.1.tar.gz'
Content type 'application/x-gzip' length 393233 bytes (384 Kb)
opened URL
==================================================
downloaded 384 Kb

trying URL 'http://cran.cs.wwu.edu/src/contrib/stringr_0.6.2.tar.gz'
Content type 'application/x-gzip' length 20636 bytes (20 Kb)
opened URL
==================================================
downloaded 20 Kb

trying URL 'http://cran.cs.wwu.edu/src/contrib/reshape2_1.2.2.tar.gz'
Content type 'application/x-gzip' length 27220 bytes (26 Kb)
opened URL
==================================================
downloaded 26 Kb

ERROR: dependency âRcppâ is not available for package âplyrâ
* removing â/home/ubuntu/R/x86_64-pc-linux-gnu-library/2.15/plyrâ
* installing *source* package âstringrâ ...
** package âstringrâ successfully unpacked and MD5 sums checked
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded

* DONE (stringr)
ERROR: dependency âplyrâ is not available for package âreshape2â
* removing â/home/ubuntu/R/x86_64-pc-linux-gnu-library/2.15/reshape2â

The downloaded source packages are in
        â/tmp/RtmpxP5OIc/downloaded_packagesâ
Warning messages:
1: In install.packages("reshape2") :
  installation of package âplyrâ had non-zero exit status
2: In install.packages("reshape2") :
  installation of package âreshape2â had non-zero exit status
> 

I tried to then install the missing Rcpp but get the error message:

Warning message:
package âRcppâ is not available (for R version 2.15.3) 

I searched some more and discovered that Rcpp now requires R version 3.x but that there is a RcppClassic version that is backwards compatible.

When trying to install RcppClassic, I get:

Installing package(s) into â/home/ubuntu/R/x86_64-pc-linux-gnu-library/2.15â
(as âlibâ is unspecified)
Warning: dependency âRcppâ is not available
trying URL 'http://cran.cs.wwu.edu/src/contrib/RcppClassic_0.9.5.tar.gz'
Content type 'application/x-gzip' length 185057 bytes (180 Kb)
opened URL
==================================================
downloaded 180 Kb

ERROR: dependency âRcppâ is not available for package âRcppClassicâ
* removing â/home/ubuntu/R/x86_64-pc-linux-gnu-library/2.15/RcppClassicâ

The downloaded source packages are in
        â/tmp/RtmpxP5OIc/downloaded_packagesâ
Warning message:
In install.packages("RcppClassic") :
  installation of package âRcppClassicâ had non-zero exit status

I then tried and was able to install Rcpp using "sudo apt-get install r-cran-rcpp":

$ sudo apt-get install r-cran-rcpp                                             
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libgudev-1.0-0 gir1.2-gudev-1.0
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  littler r-cran-int64
Suggested packages:
  r-cran-getopt r-cran-inline
The following NEW packages will be installed:
  littler r-cran-int64 r-cran-rcpp
0 upgraded, 3 newly installed, 0 to remove and 3 not upgraded.
Need to get 2,899 kB of archives.
After this operation, 11.2 MB of additional disk space will be used.
Do you want to continue [Y/n]? Y
Get:1 http://us-west-2.ec2.archive.ubuntu.com/ubuntu/ precise/universe littler amd64 0.1.5-1 [32.2 kB]
Get:2 http://us-west-2.ec2.archive.ubuntu.com/ubuntu/ precise/universe r-cran-int64 amd64 1.1.2-1 [359 kB]
Get:3 http://us-west-2.ec2.archive.ubuntu.com/ubuntu/ precise/universe r-cran-rcpp amd64 0.9.9-1 [2,508 kB]
Fetched 2,899 kB in 0s (8,959 kB/s)
Selecting previously unselected package littler.
(Reading database ... 60157 files and directories currently installed.)
Unpacking littler (from .../littler_0.1.5-1_amd64.deb) ...
Selecting previously unselected package r-cran-int64.
Unpacking r-cran-int64 (from .../r-cran-int64_1.1.2-1_amd64.deb) ...
Selecting previously unselected package r-cran-rcpp.
Unpacking r-cran-rcpp (from .../r-cran-rcpp_0.9.9-1_amd64.deb) ...
Processing triggers for man-db ...
Setting up littler (0.1.5-1) ...
Setting up r-cran-int64 (1.1.2-1) ...
Setting up r-cran-rcpp (0.9.9-1) ...

But when I tried to install "reshape2" in R, I got the same error messages as before.

What I don't understand is why I'm getting the error message:

Warning: dependency âRcppâ is not available

Since 'sudo apt-get install r-cran-rcpp' worked

After some more searching, I found a vignette on how to use RcppClassic here: http://cran.r-project.org/web/packages/RcppClassic/vignettes/RcppClassic-intro.pdf

However, making modifications to the DESCRIPTION, NAMESPACE and MAKEVAR files is starting to go beyond my capabilities so I'm reaching out for help.

Here's the output from sessionInfo():

> sessionInfo()
R version 2.15.3 (2013-03-01)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=C                 LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base    

Thanks in advance!

EDIT 3/15/2014: My "use case" is that I'm running a series of periodic jobs on AWS EC2 instances so I don't need the latest/greatest software features. What I have using R 2.15 on my Mac development machine works so I was just looking to port what I have to my AWS EC2 Ubuntu instances.

The packages I use are: reshape2, xlsx (and xlsxjars), RJSONIO, stringr, R2HTML, RCurl, plots, lattice, latticeExtra, gdata and ggplot2.

Mac471
  • 423
  • 5
  • 16
  • I think reshape2 is included in the default R installation. – Fernando Mar 15 '14 at 02:31
  • @Fernando, that's not correct. Marc471, which packages that you use are not available for R 3.x? – A5C1D2H2I1M1N2O1R2T1 Mar 15 '14 at 02:35
  • @Ananda Sorry, i didn't knew that... But i always did require(reshape2), never install.packages('reshape2'). Both on linux and Mac OSX. – Fernando Mar 15 '14 at 02:41
  • @Fernando, it is very possible that it got installed when you were installing another package that required it. – A5C1D2H2I1M1N2O1R2T1 Mar 15 '14 at 02:42
  • @AnandaMahto Good to know thanks! I always assumed reshape2 comes by default. – Fernando Mar 15 '14 at 02:47
  • @Fernando, I didn't realize your question was directed to me. I updated the original post with the packages that I use. I will set up a new EC2 instance running R 3.0 this weekend and report back as to which packages are not available for 3.0 (when I last checked, it was several months ago so at that time I had to stay with 2.15). – Mac471 Mar 15 '14 at 17:13

1 Answers1

6

A few things:

  1. You insist on Ubuntu 12.04 LTS. A stable distribution. That is fine. Your choice. It also means you chose to freeze your software at a point a few months before April 2012.

  2. Now you want something from CRAN. Something current. That is in conflict with the previous point.

  3. Either you stay in distro. Or you become current.

  4. Read the Ubuntu README and learn to how to stay with Ubuntu 12.04 yet at the same time get a current R package.

  5. Install R 3.0.3 (current) via that repo.

  6. Install the CRAN packages you want into /usr/local/lib/R/site-library.

Dirk Eddelbuettel
  • 360,940
  • 56
  • 644
  • 725
  • 1
    Exactly. As the song goes, "you can't always get what you want// but if you try sometimes// you just might find// you get what you need" – Carl Witthoft Mar 15 '14 at 12:53
  • I'd plus-10 that comment if only I could :) – Dirk Eddelbuettel Mar 15 '14 at 12:58
  • @Dirk - I only used Ubuntu 12.04 LTS because that was the current "Linux" offering on AWS EC2 at the time I started this project in 2013. I'm not wedded to that version if it makes doing what I want easier (which is to stay with R 2.15 if possible). I updated my original post with my use case which should hopefully explain why I am headed down this path. I'll look into the link you sent and see if I can upgrade everything to R 3.0 now. – Mac471 Mar 15 '14 at 17:18
  • I see. Well yes, LTS is very common on servers. But the link I provided guides you to Ubuntu repo on CRAN which many of us use to have current R binaries. Also look at Michael's c2d4u repo. – Dirk Eddelbuettel Mar 15 '14 at 17:42
  • @Dirk - I was able to install all the packages I need (including the subject of this post: reshape2) on R 3.0 running on Ubuntu 12.04 LTS using the instructions you provided. Thanks! – Mac471 Mar 19 '14 at 05:04