cannot install phytools in ubuntu 18.04 with R 3.6 - r

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 '#'.

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.

Docker build cannot fetch 'R.utils'

In my Dockerfile I have the following lines:
FROM rocker/verse:latest
RUN R -e "install.packages(c('R.utils'), repos = 'https://cran-archive.r-project.org')"
When I run docker build . I got:
> install.packages(c('R.utils'), repos = 'https://cran-archive.r-project.org')
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
Warning: unable to access index for repository https://cran-archive.r-project.org/src/contrib:
cannot open URL 'https://cran-archive.r-project.org/src/contrib/PACKAGES'
Warning message:
package ‘R.utils’ is not available (for R version 4.0.2)
I'm new to Docker, not too sure what I'm doing wrong. I put https://cran-archive.r-project.org/src/contrib/PACKAGES in browser and it couldn't load, should I try a different repo URL?
Thanks!
Try any of the advertised mirrors, and they should have the most recent release of R.utils for your version of R-4.0.2.
That CRAN mirror is specifically for old versions of R. Since your version of R (4.0.2) is not old, it is not found there. That cran-archive is intended for R versions without support for those packages (ergo the "archive" label, I suspect).
From the R FAQ 2.10:
Since March 2016, “old” material is made available from a central CRAN archive server (https://CRAN-archive.R-project.org/).
Or perhaps from the R for Mac OS X page:
Package binaries for R versions older than 3.2.0 are only available from the CRAN archive so users of such versions should adjust the CRAN mirror setting (https://cran-archive.r-project.org) accordingly.
Both of these suggest that repos = 'https://cran-archive.r-project.org' should be used for old versions of R, but your error reports R-4.0.2 (not old)
yes, you have to mention the full path to the repo. https://cran.r-project.org/src/contrib/R.utils_2.9.2.tar.gz use this repo link to get R.util.
You can also run the command sudo apt-get install -y r-cran-r.utils to install R.utils

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.

Forecast package not working on Databricks (R-version 3.5.2)

I installed the 'forecast' package in a Databricks environment a few days back. It was working fine until this morning when I restarted the cluster. Now, I can't install the package anymore. Could someone help with this?
Have already tried upgrading the current R version (3.5.2) to the latest (3.6.0). That would require upgrading the current Ubuntu version too, which I don't think is possible, since that is the version Databricks is linked to. If there's a way to upgrade the Ubuntu version as well, do let me know.
Here's a screenshot of the error:
FROM THE SCREENSHOT, The 'quadprog' latest version 1.5-5 supports only >= R-3.6 version as yours is R-3.5.2, I would suggest you to download old binaries from CRAN for quadprog and install (refer Install previous versions of R on ubuntu)
After installing quadprog, go for the other packages installation. If same error persists, please repeat above step for that packages too :)
If you are trying this operation through R Console, you can use
packageurl <- "https://cran.r-project.org/src/contrib/Archive/quadprog/quadprog_1.5-4.tar.gz"
install.packages(packageurl, repos=NULL, type="source")

Error in installing packages from RStudio

I have been trying to install the package "doby" from RStudio (ver 0.98.501 ) on ubuntu 13.04 but it keeps throwing the following warning and the package does not get installed.
Warning in install.packages :
package ‘doBy’ is not available (for R version 2.15.2)
I have followed all the instructions given here :
http://www.r-bloggers.com/installing-r-packages/
Can someone please suggest where I might be going wrong ?
If you are on Ubuntu, please see this README for Ubuntu from CRAN --- it will allow you to get to the current version of R (today 3.0.2, in a few days 3.0.3) with mininal effort.
Once you have a current R version, getting the doBy package (which depends on it) installed is a piece of cake too.
If however you prefer to stay with your version of R, you can manually fetch an older version of doBy from its CRAN archive. Download to, say, /tmp and run R CMD INSTALLby hand on it.
From http://cran.r-project.org/web/packages/doBy/index.html, package doBy depends on R version 3.0 and above. Your R version is 2.15.2. You will need to install a later version of R, and then change the settings in Rstudio to target the updated version.

Resources