Rcpp not installing properly, R2.15.2 - r

Installing Rcpp on Linux Ubuntu 12.04, with R2.15.2
NB both R and rcpp were installed yesterday; so I would expect the most recent versions, but Rcpp is installed as an out of date version!
> old.packages()
Package LibPath Installed Built ReposVer
Rcpp "Rcpp" "/usr/lib/R/site-library" "0.9.9" "2.14.1" "0.10.2"
rgl "rgl" "/usr/lib/R/site-library" "0.92.798" "2.12.1" "0.92.894"
Repository
Rcpp "http://www.stats.bris.ac.uk/R/src/contrib"
rgl "http://www.stats.bris.ac.uk/R/src/contrib"
> update.packages("Rcpp")
As the last line shows, it has not updated the package Rcpp at all; What is causing this and what can I do to resolve this?
NB Tried re-installing from two different repositories, both of which claimed to have the most recent version 0.10.2 of rcpp.
Regards
Jefe

You simply misunderstand.
The Rcpp you have is from Ubuntu and installed via apt-get et al. That version is frozen when the distro freezes. This is similar to how gcc, emacs, ... are not the most current version available now but the version taken when the distro was made.
And as an aside, even that Ubuntu version is now dated by one release as 12.10 is out...
So your question title is wrong. The version you have is installed correctly as the version that is part of Ubuntu 12.04. Makes sense now?
Now, if you install Rcpp from CRAN via install.packages() you will get the current version, idem for rgl.
(And there is also a PPA on launchpad which likely to have both as prebuild .deb packages.)
Lastly, and explained before, the path /usr/lib/R/site-library is for the r-cran-* packages you install as .deb files where /usr/local/lib/R/site-library is for your local
installs from R itself. Because of that split, the output of old.packages() that is driven from the former path, eg /usr/lib/R/site-library is bound to behind because it is managed by the distribution, here Ubuntu. You chose the distro for the stability of its components -- and you are free to augment it with CRAN packages in /usr/local/lib/R/site-library. And that is definitely a feature.
Witness this from my Ubuntu box:
R> old.packages(lib.loc="/usr/local/lib/R/site-library/")
NULL
R>

Related

How to install RQDA version in R version 4.02?

How to install RQDA version in R version 4.02?
Warning in install.packages :
package ‘RQDA’ is not available (as a binary package for R version 4.0.2)
You could have a look at the fork at https://github.com/RQDA/RQDA. Since packages that RQDA rely on have been archived on CRAN (RGtk and GtkWidgets), RQDA was archived subsequently.
The official published package has been archived, because of some of its dependencies. However, the package can still be installed from the archives. The steps to do this are as follows:
Install RGtk2 from CRAN.
Install the archived versions of gWidgets and gWidgetsRGtk2. devtools::install_version can do this quite easily when the right arguments are passed to the function. Consult the help file.
Call library(RGtk2) at the R console. You will be prompted to install the GUI library Gtk+, if you don't already have it.
Install the archived version of RQDA from CRAN. If you are using a 64-bit system, you will have to pass the --no-multiarch flag, or else it will fail.
Launch RQDA with library(RQDA).
I have used these steps to successfully install the package on Windows 10 64-bit running R-4.0.3. Others have used a similar algorithm to do it on Linux and Mac with only slight variations.
Since I had to replicate this for some members of my team I wrote an R script that can be used to carry out the installation. You are welcome to try it out.
That said, development on the main RQDA branch has recommenced, so I expect a resolution of this issue in the near future.

cannot install phytools in ubuntu 18.04 with R 3.6

cannot install phytools
tried with devtools
library(devtools)
install_github("liamrevell/phytools")
and
install.packages("phytools")
I keep getting the same error
ERROR: dependency ‘mnormt’ is not available for package ‘phytools’
and I cannot install mnormt because
package ‘mnormt’ is not available (for R version 3.6.3)
gfortran is already installed in my system
GNU Fortran (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
any help is highly appreciated,
thanks
On Ubuntu Linux I cannot get R to update to the latest version (>4.0 at the time of writing), so, like Dirk suggests I have to install an older version of the package, one compatible with the version of R I am running.
My R version is 3.6.3, released feb 2020
I go to the mnormt page and click on "old sources" https://cran.r-project.org/src/contrib/Archive/mnormt/
I see that version 1.5-6 is the most recent release which is prior to my version of R
Following these pages: "Installing older versions of packages" https://support.rstudio.com/hc/en-us/articles/219949047-Installing-older-versions-of-packages I copy the relevant url into this code and run it in R
packageurl <- "https://cran.r-project.org/src/contrib/Archive/mnormt/mnormt_1.5-6.tar.gz"
install.packages(packageurl, repos=NULL, type="source")
Which fixes my problem installing mnormt and also allows packages which depend on it to be installed in the standard way (as far as I tested it)
The current version of mnormt depends on a the current version of R; you chose to remain a version behind.
So just install the previous version of mnormt, for example via
cd /tmp
wget https://cran.r-project.org/src/contrib/Archive/mnormt/mnormt_1.5-7.tar.gz
R CMD INSTALL mnormt_1.5-7.tar.gz
Prefix that last INSTALL command with sudo, or change the permission/group membership of /usr/local/lib/R/site-library, if R tells you it cannot write there.
Once mnormt is installed, proceed with the installation of phytools.
Try to add the tag version to install command, for example: devtools::install_github('cran/mnormt#R-3.0.3')
Check what version you need and replace the tag after the '#'.

r-cran-packages on ubuntu repos

usually I install R packages from CRAN mirrors, but some of them give me problems. This almost always happens with packages strongly interacting with the system (e.g. rgl, cairoDevices etc). If I well understood when I install packages from the Ubuntu repo with
apt-get install r-cran-rgl
these will be installed in /usr/lib/R/site-library directory. For a number of packages installed in /usr/lib/R/site-library when I do update.packages(ask=FALSE) from R (working under sys admin) I get the following type of messages:
Warning: package 'ggplot2' in library '/usr/lib/R/site-library' will not be updated
I presume that this happens because the version on the cran is newer than the one on the ubuntu repos. But, the rgl package is installed
in '/usr/lib/R/site-library', however when I invoke
update.packages(ask=FALSE)
R download and tries to install a new version of rgl although the one installed is the last one available on ubuntu repos. By the way it tries to install and it fails for some error.
Therefore, what I don't understand is why it doesn't try to update ggplot2 while it tries to update rgl when both have been installed via apt-get and both have the last release number appearing on the ubuntu repos.
Thanks
Pierre

Why does adding a Depends argument to a package DESCRIPTION cause it not to be compiled for versions after the specified one?

I've just released a package to CRAN which has the following line in the DESCRIPTION file:
Depends: R (>= 2.12.0)
I have never used such a line in a package DESCRIPTION file before, and never had any troubles.
I received the following message a few hours ago, as is typical for CRAN releases:
Dear package maintainer,
this notification has been generated automatically.
Your package maRketSim_0.9.tar.gz has been built for Windows and
will be published within 24 hours in the corresponding CRAN directory
(CRAN/bin/windows/contrib/2.13/).
R version 2.13.1 Patched (2011-07-20 r56455)
All the best,
Uwe Ligges
(Maintainer of binary packages for Windows)
Now with this package, install.packages(maRketSim) on Windows in R 2.13.1 returns:
In getDependencies(pkgs, dependencies, available, lib) :
package ‘maRketSim’ is not available (for R version 2.13.1)
The same error occurs in R 2.13.0 on Windows.
Yet the install works just fine in R 2.12.2 on the same machine.
Did including the Depends line mess things up?
It works for me on Linux. CRAN says that there are currently no binary builds for Windows or MacOS X. What system/OS were you trying the install on when it failed.
Uwe's (automated) message does mention that it might take up to 24 hours for the new build to reach CRAN and thence out to whatever mirror you are using.
And this does appear to be the issue: there is a binary for maRketSim in http://cran.r-project.org/bin/windows/contrib/2.12/ but not yet in http://cran.r-project.org/bin/windows/contrib/2.13/
You just need to wait a little while before you can install the binary for the 2.13.x branch of R/

Install R packages from binary in Ubuntu Lucid

I've installed R in Ubuntu Lucid with the command
sudo aptitude install r-base
When I try to "install.packages" it seems to download source and then spend ages compiling it. How can I get it to just download and install the binaries, like I'm used to on Windows?
Is there any need to compile the packages myself? I'm running inside a VM so it would be great to keep things as slim as possible.
Thanks
CRAN only distributes source for Unix, in other words no binaries are offered (unlike for Windows). So you simply have to compile the packages locally.
That said, we have been working for a few years now on a system to turn CRAN source packages into Debian binary packages -- see cran2deb / debian.cran.r-project.org. We currently build i386 binaries for Debian testing and are in the process of rewriting the backend to offer amd64 for Debian again and then eventually i386 and amd64 for Ubuntu. This already offers well over two-thousand binary packages but not yet for all the flavours we would like to support eventually.
If and when that goal will be accomplished is hard to say; this is a volunteer effort and the main developer (Charles) recently lost his laptop.
CRAN packages are available in the Ubuntu package repository, but are updated with CRAN only when Ubuntu is updated. If you want to use the latest CRAN version of a package and the repository is not at the same version, you will need to go through the compilation/installation procedure.
Details in the Ubuntu R packages can be found on CRAN, which should give you all the information you require.
As this (the provision of binaries) is all volunteer effort on the part of the CRAN maintainers, R Core and other devoted members of the community (e.g. Dirk, Vincent and Michael for the Debian and Ubuntu packages), the main effort has gone into providing binaries for systems where self-compilation is more difficult as the necessary tools are not easily available, unlike on Linux.

Resources