Installing newest older compatible version R of package - r

Installing older version of R package shows how to install a different version of an R package.
Can that be automated so I can have it install the newest (older) version that is compatible with my R installation?
In my case I need it for Rcpp, but a general solution working for any package would be preferred.

Related

R - Installing package with remotes::install_github ask for higher version of the dependencies which BiocManager::install() can not find

I need to install few packages that should be installed with remotes::install_github() like
"acidgenomics/basejump" or "satijalab/seurat".
During the installation, it need to upgrade few other packages version. The BiocManager::install program cannot find those versions and I had to install those dependencies packages version with:
R CMD INSTALL IRanges_2.20.2.tar.gz
Then other packages, that use the same packages stop working. like DESeq2,
I get the error:
Error: package or namespace load failed for ‘DESeq2’:
objects ‘rowSums’, ‘colSums’, ‘rowMeans’, ‘colMeans’ are not exported by 'namespace:S4Vectors'
I found few answers that say it happen (like url)
remotes::install_github() isn't picking up the correct Bioconductor
devel repos, whereas installing with BiocManager::install() does work
as expected.
we have the R 3.6.0 installed as a module and a lot of users uses the same R version. I need all packages to work for everyone.
How can I make all variety packages versions to work?
Finally, I install new version of R 3.6.3 with Bioconductor 3.10 and all the packages install right.

R package was installed by version with different internals

On my Win 7 Ent x64 I installed RStudio R-3.4.2.
I installed few packages that I need (RPostgreSQL, sqldf, etc..)
But when I'm executing code, these libraries give me errors:
library(RPostgreSQL)
Error: package ‘RPostgreSQL’ was installed by an R version with different internals; it needs to be reinstalled for use with this R version
In addition: Warning message:
package ‘RPostgreSQL’ was built under R version 3.5.0
All of the packages are downloaded from CRAN. RPostgrSQL is 0.6-2 version.
I'm pretty sure that solution is quite simple, but I searched a lot and still cannot find the solution.
How did you install the package RPostgreSQL? If you used
install.packages("RPostgreSQL") on your Windows it installed using binaries, which may have been built using a different R version. In your case, 3.5.0 vs 3.4.2.
Try using install.packages("RPostgreSQL", type="source"). This way your machine will compile the package from source using your version of R, and it should work.
If the package needs C/C++/Fortran compilation, you will als need RTools installed on your machine.
You can try to find all packages installed with the old version R like this:
grep 'Built: R 3.4' /usr/local/lib/R/site-library/*/DESCRIPTION > temp
and then you can uninstall the packages with remove.packages()

Does install.packages update an already installed package in R?

When using install.packages() in R, does it uninstall the currently installed version of the package and install the latest version (even if the version number hasn't changed)?

Can't install bigrf package

I'm having some extremely frustrating difficulty installing the bigrf R package.
I have tried the following:
install.packages('bigrf',repo='https://github.com/aloysius-lim/bigrf.git',type='source')
^^with dev mode on
install_github("aloysius-lim","bigrf")
install.packages("bigrf",source=true)
These have all been tried on R build 2.14 (which bigrf was built on), 2.15, 3.0.2 and 3.1.1
I am getting a not available for build x' every time.
Is bigrf defunct? I have seen a couple of posts here on SO which have used various builds of R requesting help with bigrf. the solutions IO have tried came from these threads :/
To install the current version of bigrf on CRAN:
install.packages("bigrf", dependencies=TRUE)
To install the development version on GitHub:
library(devtools)
install_github("bigrf", repo='aloysius-lim/bigrf')
Package ‘bigrf’ was removed from the CRAN repository.
Formerly available versions can be obtained from the archive.
Archived on 2015-11-21 as check problems were not corrected despite reminders from CRAN people that's what the note i get from the https://cran.r-project.org/web/packages/bigrf/index.html

Install latest R (3.x) on RHEL 5

I'd like to install the latest version of R in RHEL 5 as I tried to install some library (plyr) but it complained a dependency could not be used with my installed version of R: package ‘Rcpp’ is not available (for R version 2.15.2)
2.15.2 is the latest precompiled R binary available for RHEL5 from epel. I guess they stopped updating it. Is compiling from source to get R 3.x my only solution here or there is some binary installer somewhere else? I much rather use something like yum since it take care of all the R dependency packages as well.

Resources