12

On Ubuntu 10.04 I updated a load of the R (ubuntu) packages this morning. Then the first R script I tried told me zoo wasn't built for R 3.0.0. So I do sudo R and then update.packages(ask=F) assuming it would bring all the CRAN packages I've installed over the past couple of years into sync.

But it didn't, and zoo, Rcpp, and more don't work. In fact over half my installed packages are still built for 2.x.x; the list is below (x=installed.packages();x[sort.list(x[,'Built']),c('Built','Version','Depends','LinkingTo','NeedsCompilation')])

Is this tough, not all packages are ready for 3.0.0, and I should (in Ubuntu) revert to the previous version? Or do I need to be using a different CRAN site for 3.x.x? Would deleting all 2.x packages and then installing them fresh again fix it? Or ...?

                    Built    Version     Depends                                                            LinkingTo             NeedsCompilation 
Defaults            "2.13.1" "1.1-1"     NA                                                                 NA                    NA               
itertools           "2.13.1" "0.1-1"     "R (>= 2.5.0), iterators(>= 1.0.0)"                                NA                    NA               
openNLP             "2.13.1" "0.0-8"     NA                                                                 NA                    NA               
reshape             "2.13.1" "0.8.4"     "R (>= 2.6.1), plyr"                                               NA                    NA               
RUnit               "2.13.1" "0.4.26"    "R (>= 2.5.0), utils (>= 2.5.0), methods (>= 2.5.0)"               NA                    NA               
multicore           "2.14.1" "0.1-7"     "R (>= 2.0.0)"                                                     NA                    NA               
RMySQL              "2.15.0" "0.9-3"     "R (>= 2.8.0), methods, DBI (>= 0.2-2), utils"                     NA                    NA               
foreach             "2.15.1" "1.4.0"     "R (>= 2.5.0)"                                                     NA                    NA               
iterators           "2.15.1" "1.0.6"     "R (>= 2.5.0), utils"                                              NA                    NA               
labeling            "2.15.1" "0.1"       NA                                                                 NA                    NA               
memoise             "2.15.1" "0.1"       NA                                                                 NA                    NA               
RColorBrewer        "2.15.1" "1.0-5"     "R (>= 2.0.0)"                                                     NA                    NA               
bitops              "2.15.2" "1.0-5"     NA                                                                 NA                    NA               
e1071               "2.15.2" "1.6-1"     "class"                                                            NA                    NA               
IBrokers            "2.15.2" "0.9-10"    "xts"                                                              NA                    NA               
mgcv                "2.15.2" "1.7-22"    "R (>= 2.14.0), stats, graphics"                                   NA                    NA               
munsell             "2.15.2" "0.4"       NA                                                                 NA                    NA               
randomForest        "2.15.2" "4.6-7"     "R (>= 2.5.0), stats"                                              NA                    NA               
rbenchmark          "2.15.2" "1.0.0"     NA                                                                 NA                    NA               
tree                "2.15.2" "1.0-33"    "R (>= 2.15.0), grDevices, graphics, stats"                        NA                    NA               
tseries             "2.15.2" "0.10-30"   "R (>= 2.10.0)"                                                    NA                    NA               
zoo                 "2.15.2" "1.7-9"     "R (>= 2.10.0), stats"                                             NA                    NA               
Cairo               "2.15.3" "1.5-2"     "R (>= 2.4.0)"                                                     NA                    NA               
dichromat           "2.15.3" "2.0-0"     "R (>= 2.10), stats"                                               NA                    NA               
digest              "2.15.3" "0.6.3"     "R (>= 2.4.1)"                                                     NA                    "yes"            
doMC                "2.15.3" "1.3.0"     "R (>= 2.14.0), foreach(>= 1.2.0), iterators(>= 1.0.0),\nparallel" NA                    "no"             
FastRWeb            "2.15.3" "1.1-0"     "R (>= 2.0.0), Cairo"                                              NA                    NA               
forecast            "2.15.3" "4.03"      "R (>= 2.14.0), stats, graphics"                                   "Rcpp, RcppArmadillo" "yes"            
fracdiff            "2.15.3" "1.4-2"     NA                                                                 NA                    NA               
ggplot2             "2.15.3" "0.9.3.1"   "R (>= 2.14), stats, methods"                                      NA                    "no"             
gtable              "2.15.3" "0.1.2"     "R (>= 2.14), grid"                                                NA                    NA               
inline              "2.15.3" "0.3.11"    "R (>= 2.4.0), methods"                                            NA                    "no"             
microbenchmark      "2.15.3" "1.3-0"     NA                                                                 NA                    "yes"            
nnet                "2.15.3" "7.3-6"     "R (>= 2.14.0), stats, utils"                                      NA                    "yes"            
PerformanceAnalytics"2.15.3" "1.1.0"     "R (>= 2.14.0), zoo, xts (>= 0.8-9)"                               NA                    NA               
plyr                "2.15.3" "1.8"       "R (>= 2.11.0)"                                                    NA                    NA               
proto               "2.15.3" "0.3-10"    NA                                                                 NA                    NA               
quantmod            "2.15.3" "0.4-0"     "Defaults, xts(>= 0.9-0), zoo, TTR(>= 0.2), methods"               NA                    NA               
Rcpp                "2.15.3" "0.10.3"    "R (>= 2.15.1)"                                                    NA                    "yes"            
RcppArmadillo       "2.15.3" "0.3.800.1" "R (>= 2.14.0), Rcpp (>= 0.10.2)"                                  "Rcpp"                "yes"            
RCurl               "2.15.3" "1.95-4.1"  "R (>= 2.7.0), methods, bitops"                                    NA                    "yes"            
reshape2            "2.15.3" "1.2.2"     NA                                                                 NA                    NA               
RInside             "2.15.3" "0.2.10"    "R (>= 2.10.0), Rcpp (>= 0.8.5)"                                   "Rcpp"                NA               
rJava               "2.15.3" "0.9-4"     "R (>= 2.5.0), methods"                                            NA                    "yes"            
rjson               "2.15.3" "0.2.12"    "R (>= 2.12.0)"                                                    NA                    NA               
Rserve              "2.15.3" "1.7-0"     "R (>= 1.5.0)"                                                     NA                    NA               
RWeka               "2.15.3" "0.4-16"    "R (>= 2.6.0)"                                                     NA                    "no"             
RWekajars           "2.15.3" "3.7.9-1"   NA                                                                 NA                    "no"             
scales              "2.15.3" "0.2.3"     "R (>= 2.12), methods"                                             NA                    NA               
slam                "2.15.3" "0.1-28"    "R (>= 2.8.0)"                                                     NA                    NA               
stringr             "2.15.3" "0.6.2"     "R (>= 2.14)"                                                      NA                    NA               
tm                  "2.15.3" "0.5-8.3"   "R (>= 2.14.0), methods"                                           NA                    NA               
TTR                 "2.15.3" "0.22-0"    "xts (>= 0.9-3)"                                                   "xts"                 "yes"            
XML                 "2.15.3" "3.96-1.1"  "R (>= 1.2.0), methods, utils"                                     NA                    "yes"            
xts                 "2.15.3" "0.9-3"     "zoo (>= 1.7-2)"                                                   "zoo (>= 1.7.2)"      NA               
xtsExtra            "2.15.3" "0.0-1"     "zoo, xts"                                                         NA                    NA               
colorspace          "3.0.0"  "1.2-2"     "R (>= 2.13.0), methods"                                           NA                    "yes"            
DBI                 "3.0.0"  "0.2-7"     "R (>= 2.15.0), methods"                                           NA                    "no"             
Hmisc               "3.0.0"  "3.10-1.1"  "R (>= 2.4.0), methods, survival"                                  NA                    "yes"            
quadprog            "3.0.0"  "1.5-5"     "R (>= 2.15.0)"                                                    NA                    "yes"            
RSQLite             "3.0.0"  "0.11.3"    "R (>= 2.10.0), methods, DBI (>= 0.2-5)"                           NA                    "yes"            
base                "3.0.0"  "3.0.0"     NA                                                                 NA                    NA               
boot                "3.0.0"  "1.3-9"     "R (>= 3.0.0), graphics, stats"                                    NA                    NA               
class               "3.0.0"  "7.3-7"     "R (>= 3.0.0), stats, utils"                                       NA                    "yes"            
cluster             "3.0.0"  "1.14.4"    "R (>= 2.10.0), stats, graphics, utils"                            NA                    "yes"            
codetools           "3.0.0"  "0.2-8"     "R (>= 2.1)"                                                       NA                    NA               
compiler            "3.0.0"  "3.0.0"     NA                                                                 NA                    NA               
datasets            "3.0.0"  "3.0.0"     NA                                                                 NA                    NA               
foreign             "3.0.0"  "0.8-53"    "R (>= 2.14.0), stats"                                             NA                    "yes"            
graphics            "3.0.0"  "3.0.0"     NA                                                                 NA                    NA               
grDevices           "3.0.0"  "3.0.0"     NA                                                                 NA                    NA               
grid                "3.0.0"  "3.0.0"     NA                                                                 NA                    NA               
KernSmooth          "3.0.0"  "2.23-10"   "R (>= 2.5.0), stats"                                              NA                    "yes"            
lattice             "3.0.0"  "0.20-15"   "R (>= 2.15.1)"                                                    NA                    "yes"            
MASS                "3.0.0"  "7.3-26"    "R (>= 3.0.0), grDevices, graphics, stats, utils"                  NA                    "yes"            
Matrix              "3.0.0"  "1.0-12"    "R (>= 2.15.0), stats, methods, utils, lattice"                    NA                    "yes"            
methods             "3.0.0"  "3.0.0"     NA                                                                 NA                    NA               
mgcv                "3.0.0"  "1.7-22"    "R (>= 2.14.0), stats, graphics"                                   NA                    NA               
nlme                "3.0.0"  "3.1-109"   "graphics, stats, R (>= 3.0.0)"                                    NA                    NA               
nnet                "3.0.0"  "7.3-6"     "R (>= 2.14.0), stats, utils"                                      NA                    "yes"            
parallel            "3.0.0"  "3.0.0"     NA                                                                 NA                    NA               
rpart               "3.0.0"  "4.1-1"     "R (>= 2.14.0), graphics, stats, grDevices"                        NA                    "yes"            
spatial             "3.0.0"  "7.3-6"     "R (>= 3.0.0), graphics, stats, utils"                             NA                    NA               
splines             "3.0.0"  "3.0.0"     NA                                                                 NA                    NA               
stats               "3.0.0"  "3.0.0"     NA                                                                 NA                    NA               
stats4              "3.0.0"  "3.0.0"     "methods, graphics, stats"                                         NA                    NA               
survival            "3.0.0"  "2.37-4"    "stats, utils, graphics, splines, R (>= 2.13.0)"                   NA                    "yes"            
tcltk               "3.0.0"  "3.0.0"     NA                                                                 NA                    NA               
tools               "3.0.0"  "3.0.0"     NA                                                                 NA                    NA               
utils               "3.0.0"  "3.0.0"     NA                                                                 NA                    NA               
Darren Cook
  • 27,837
  • 13
  • 117
  • 217
  • BTW There are 110 packages on CRAN that depend on Rcpp, and they all work with R 2.15.* _and_ R 3.0.0, but you need to properly take care of things at your end. – Dirk Eddelbuettel May 12 '13 at 02:19
  • 2
    As an aside: using `sudo` is probably not a great idea; it would be better to make yourself a member of the group that owns the library directory. – GSee May 12 '13 at 14:15
  • You may want to get rid of a few of your columns so that the important column (far right) is easier to find (not needing to scroll). I missed it first time looking at this post. – Clayton Stanley May 13 '13 at 20:46
  • @ClaytonStanley Good point, just edited. – Darren Cook May 14 '13 at 00:02

2 Answers2

34

The required command is not what you state: update.packages(ask=F) but rather the following update.packages(ask=FALSE, checkBuilt=TRUE).

Try that, and all the still-maintained and available CRAN packages will of course be taken care of. Things you installed from github, Simon's rforge, r-forge, or other random repo will need manual help.

This issue has been discussed at length at various venues since R 3.0.0 came out.

baptiste
  • 75,767
  • 19
  • 198
  • 294
Dirk Eddelbuettel
  • 360,940
  • 56
  • 644
  • 725
  • 1
    Thanks Dirk, that fixed it. You'll be glad it has now been discussed on StackOverflow too - it'll earn you lots of rep ;-) – Darren Cook May 12 '13 at 06:23
  • 2
    Just for clarification; are we now in a situation where the Debian/Ubuntu r-cran apt packages are behind and will screw up everything like texlive? I can't seem to make any of these solutions work, so I'm removing everything and starting over from `r-base`. – bright-star Jan 18 '14 at 22:48
  • @TrevorAlexander: That is an unanswerable question. What distro? What version? What is your issue? Ask something tangible and reproducible on the r-sig-debian list (which servers for Ubuntu too) rather than hijacking an 18 months old question here. – Dirk Eddelbuettel Jan 18 '14 at 22:57
  • Sure, no problem. I was attempting to adhere to SO etiquette by avoiding opening a duplicate question, not 'hijacking' anything. – bright-star Jan 18 '14 at 22:59
4

Dirk's answer got me most of the way, leaving just xtsExtra, which was installed from R-Forge. I recommend against update.packages(ask=FALSE, checkBuilt=TRUE, repos="http://R-Forge.R-project.org") as that appears to update some of the CRAN packages with their R-Forge version; that might mean it installs more experimental versions (?).

So, I did this instead:

remove.packages('xtsExtra')
install.packages("xtsExtra", repos="http://R-Forge.R-project.org")
Darren Cook
  • 27,837
  • 13
  • 117
  • 217
  • 2
    Have you seen [this post](http://stackoverflow.com/questions/3971815/automagically-update-packages-installed-from-r-forge)? – GSee May 12 '13 at 14:14
  • Thanks @Gsee. That was interesting, not least to show that there is not a simpler way. Well, actually, there is a simpler way: see my answer ;-) – Darren Cook May 13 '13 at 10:51
  • I don't follow. You're suggesting removing all packages that you want to update from R-Forge, then reinstalling them? – GSee May 13 '13 at 11:59
  • 1
    Does this work: `options(repos = c(CRAN='http://cran.us.r-project.org', RForge='http://r-forge.r-project.org')); update.packages(ask=FALSE, checkBuilt=TRUE)`. I'm pretty sure that will update CRAN packages from CRAN, and anything not found on CRAN from R-Forge. – GSee May 13 '13 at 11:59
  • 1
    @GSee Sadly, no. I ran with ask=TRUE, and the first thing it asks permission to upgrade is itertools from 0.1-1 (the CRAN version) to 0.1-3 (the R-Forge version). Good idea though :-) – Darren Cook May 13 '13 at 23:58
  • You're right. That's good to know. Thanks. That makes sense I guess because if it worked, Sharpie's answer to the post I linked to wouldn't have been needed. – GSee May 14 '13 at 00:59