Problems installing older version of Bioconductor's mixOmics packages in R - r

I've spent the day trying to load the appropriate package versions in R that I saved in a renv lockfile.
I used the package RVAideMemoire which is tied in with mixOmics in bioconductor, which can't be loaded automatically using renv::restore().
I followed the steps outlined here to install the appropriate version of bioconductor (3.11) to get moxOmics version 6.12.1.
R how to install a specified version of a bioconductor package?
Unfortunately I ended up with mixOmics version 6.14.1.
I attempted to load the earlier version using:
BiocManager::install("mixOmics", version = '6.12.1')
which resulted in the following error:
Error: version '6.12.1' must have two components, e.g., '3.7'
This seemed somewhat unclear, and I thought the additional ".1" at the end might be causing problems, but what I tried loading the version omitting the last ".1" as shown:
BiocManager::install("mixOmics", version = "6.12")
I got another error:
Error: unknown Bioconductor version '6.12'; see https://bioconductor.org/install
I'm at a bit of a loss here. The renv::restore() function won't complete the update as long as the mixOmics package install keeps failing, so I seem to be a bit stuck until I can get this straightened out.
EDIT
Just to provide some more info for the renv error, here's the message I get:
Error: failed to retrieve package 'mixOmics'
In addition: Warning messages:
1: In system2("curl", args$data(), stdout = TRUE, stderr = TRUE) :
running command '"curl" --config "C:/Users/Corey/AppData/Local/Temp/RtmpuYYvKB/renv-tempdir-3d7050aa2ac3/renv-download-config-3d7076f57e1c"' had status 22
2: In downloader(url, destfile, type, request, headers) :
curl: (22) The requested URL returned error: 404
3: In system2("curl", args$data(), stdout = TRUE, stderr = TRUE) :
running command '"curl" --config "C:/Users/Corey/AppData/Local/Temp/RtmpuYYvKB/renv-tempdir-3d7050aa2ac3/renv-download-config-3d701ff05e24"' had status 22
4: In downloader(url, destfile, type, request, headers) :
curl: (22) The requested URL returned error: 404`
After trying initial suggestion of using
options(renv.settings.bioconductor.version = "3.11") renv::install("bioc::mixOmics#6.12.1")
I got the following errors:
'getOption("repos")' replaces Bioconductor standard repositories, see '?repositories' for details
replacement repositories: CRAN: https://cran.rstudio.com
Querying repositories for available binary packages ... Done!
Querying repositories for available source packages ... Done!
Retrieving 'https://bioconductor.org/packages/3.12/bioc/src/contrib/Archive/mixOmics/mixOmics_6.12.1.tar.gz' ...
Retrieving 'https://bioconductor.org/packages/3.12/data/annotation/src/contrib/Archive/mixOmics/mixOmics_6.12.1.tar.gz' ...
Retrieving 'https://bioconductor.org/packages/3.12/data/experiment/src/contrib/Archive/mixOmics/mixOmics_6.12.1.tar.gz' ...
Retrieving 'https://bioconductor.org/packages/3.12/workflows/src/contrib/Archive/mixOmics/mixOmics_6.12.1.tar.gz' ...
Retrieving 'https://bioconductor.org/packages/3.12/books/src/contrib/Archive/mixOmics/mixOmics_6.12.1.tar.gz' ...
Retrieving 'https://cran.rstudio.com/src/contrib/Archive/mixOmics/mixOmics_6.12.1.tar.gz' ...
Error: failed to retrieve package 'mixOmics'
In addition: There were 24 warnings (use warnings() to see them)

BiocManager::install() doesn't provide an interface for installing specific versions of a package. The documentation for the version argument states:
version: 'character(1)' Bioconductor version to install, e.g.,
'version = "3.8"'. The special symbol 'version = "devel"'
installs the current 'development' version.
That is, it relates to the Bioconductor version, not the package version.
That said, you should be able to use renv to install a specific version of the package from Bioconductor. For example:
options(renv.settings.bioconductor.version = "3.11")
renv::install("bioc::mixOmics#6.12.1")
You could also use renv::settings$bioconductor.version("3.11") to store the required version of Bioconductor as a project setting, to be used by renv during restore().
I used the package RVAideMemoire which is tied in with mixOmics in bioconductor, which can't be loaded automatically using renv::restore().
I'd be curious to know why renv::restore() is failing for you.
EDIT: Based on your output, you're trying to use Bioconductor 3.12, but mixOmics 6.12.1 isn't available from that version of Bioconductor. You need to set the Bioconductor version used by renv as detailed in this answer. (You might also need to install the latest version of renv to gain support for this.)

Related

package from Bioconductor has a dependency from CRAN that requires version of R that is not compatible

A particular situation we've encountered is when we try to install a specific R package version from Bioconductor. Dependencies of this package may not be pinned, which means that the latest and greatest dependency will be installed from CRAN. The problem arises when this new latest and greatest dependency refers to an R version that is not compatible with the Bioconductor release in which the original package is being installed. At this point installation process tips over and crashes spectacularly.
For example, DESeq2 ver. 1.30.1 is from the 3.12 relase of Bioconductor which in turn depends on R 4.0. DESeq2 Depends on unpinned version of locfit and latest version depends on R >= 4.1, making the installation process fail.
➜ docker run --rm -it r-base:4.0.4 bash --login
root#e2475c214bce:/# R
> install.packages("renv")
...
> renv::install("bioc::DESeq2#1.30.1")
...
Error: failed to retrieve package 'DESeq2#1.30.1'
In addition: Warning message:
In state$requirements[[record$Package]] :
wrong arguments for subsetting an environment
Traceback (most recent calls last):
8: renv::install("bioc::DESeq2#1.30.1")
7: retrieve(names(remotes))
6: handler(package, renv_retrieve_impl(package))
5: renv_retrieve_impl(package)
4: renv_retrieve_bioconductor(record)
3: renv_retrieve_repos(record)
2: stopf("failed to retrieve package '%s'", renv_record_format_remote(record))
1: stop(sprintf(fmt, ...), call. = call.)
Let's ignore the fact that the error message from renv is not helpful and install locfit by hand.
> renv::install("locfit")
Error: package 'locfit' is not available
Error during wrapup:
Error: no more error handlers available (recursive errors?); invoking 'abort' restart
Naturally this fails because the latest version of locfit depends on R>=4.1.
The solutions here are:
pin dependencies in DESeq2, but this is unlikely to happen for older versions
manually install compatible version of locfit that doesn't depend on R>=4.1 prior to installing DESeq2
Are there other ways of solving this that elude me?

Failing to install panelr package

I am failing to read in the panelr package from the library. I used the package utilising its wbm() function on some panel data earlier this year and I have even tried to install it and I get this message: Warning in install.packages : package ‘panelr’ is not available (for R version 3.6.3).
Has the package been removed? Kindly assist on how I can install it or the new version of it.
If we want a specific version, use the versions package
install.packages('versions')
Then use
library(versions)
install.versions('panelr', '0.7.3')
If that version is not available in the MRAN repo, check the available versions with
available.versions('panelr')
If there are no versions available, then it returns an error. In that case, an option is to download the archived tar file from https://cran.r-project.org/src/contrib/Archive/panelr/ and then use install.packages to with source = TRUE
install.packages('path/to/.../...tar.gz', source = TRUE, repos = NULL)
Regarding your other question: Yes, it seems as it has been removed.

Installing packages under R devel version

I'm using the current R-devel version (3.3.0, r68650). If I try to install an R package then the following error occurs:
> install.packages('RCurl')
--- Please select a CRAN mirror for use in this session ---
Error in url("https://cran.r-project.org/CRAN_mirrors.csv") :
https:// URLs are not supported
Actually I read that to be able to use https urls I have to install RCurl first.
As next I tried to set the repos parameter explicit to the HTTP version:
> install.packages('RCurl', repos='http://cran.r-project.CRAN_mirrors.csv')
Warning: unable to access index for repository http://cran.r-project.CRAN_mirrors.csv/src/contrib
Warning message:
package ‘RCurl’ is not available (for R Under development)
The problem appears is not only with the RCurl package but any package I tried.
how can I install packages on the R Development version?
You need to pick a mirror from that csv file. The csv isn't a mirror itself.

problem when installing RTextTools for R

I was trying to install RTextTools package for R, but failed. Here is the output from the screen
> > install.packages("RTextTools")
Warning in install.packages("RTextTools") :
argument 'lib' is missing: using 'C:\Users\datamining\Documents/R/win-library/2.10'
--- Please select a CRAN mirror for use in this session ---
Warning: unable to access index for repository http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/2.10
Warning message:
In getDependencies(pkgs, dependencies, available, lib) :
package ‘RTextTools’ is not available
What's the reason for this problem, and how to fix it? Thanks.
There are two distinct, but related, issues:
You are running version 2.10 of R which is two years old. CRAN supports only the current version with pre-built binaries. You could try installing from source.
RTextTools, as can be seen on its CRAN page also requires at least R version 2.13.
So in short: you should upgrade.
I have resolved the issue. I have Download RTextTools From Given Link.

https://cran.r-project.org/src/contrib/Archive/RTextTools/
and copy RTextTools_1.4.2.tar.gz file in project root folder then run this command in project folder in terminal
"R CMD INSTALL RTextTools_1.4.2.tar.gz"
After running this command I receive below error
"ERROR: dependencies ‘SparseM’, ‘randomForest’, ‘tree’, ‘e1071’, ‘ipred’, ‘caTools’, ‘maxent’, ‘glmnet’, ‘tau’ are not available for package ‘RTextTools’".
Now install each dependencies from RStudio or RConsole (Any Editor used by you) by simply running this code.
install.packages("caTools").
Install all 9 required packages One By One (In My Case it was 9 Packages Dependencies required by RTextTools) all packages will be installed except 'maxent'.
Now download maxent from the given link.
https://cran.r-project.org/src/contrib/Archive/maxent/.
and copy maxent_1.3.3.1.tar file in project folder then run this command in project folder in terminal.
"R CMD INSTALL maxent_1.3.3.1.tar"
Now For RTextTools Run this command again in Terminal.
"R CMD INSTALL RTextTools_1.4.2.tar.gz"
All is done Now..
But the Last Step is
Load the RTextTools using.
library(RTextTools)
You will see one more Error: Load SparseM Now Loading SparseM use code below.
library(SparseM)
and in the last Load RTextTools
library(RTextTools)
RTextTools is dependent on a number of packages, most of which require R 2.13+. You should always keep R updated to the latest version, since each update contains numerous bug fixes and performance enhancements.
If you can't install packages from repository or the packages are not available anymore, just follow this steps:
Install.packages("devtools")
check -- library("devtools")
install_github("cran/maxent")
install_github("cran/RTextTools")

R Newbie Confused about Install Packages

I am somewhat new to R, and I thought I understood how to install packages from CRAN mirrors and from source files, but now I am stumped. I currently am using R 2.10.0 on a Windows 7 32-bit machine.
I want to try to use the RGoogleAnalytics package found here and am trying to follow the instructions. They instruct us to install both RCurl and the XML packages from omegahat. For example,
install.packages("RCurl", repos = "http://www.omegahat.org/R")
however this does not work, as I get the following error:
Warning message:
In getDependencies(pkgs, dependencies, available, lib) :
package ‘RCurl’ is not available
When I try this instead:
install.packages("RCurl", repos = "http://www.omegahat.org/R", type="source")
I get the following error after the file downloads. I previously had version 1.0 and that is restored.
trying URL 'http://www.omegahat.org/R/src/contrib/RCurl_1.5-0.tar.gz'
Content type 'application/x-gzip' length 735041 bytes (717 Kb)
opened URL
downloaded 717 Kb
* installing *source* package 'RCurl' ...
Warning in system("sh ./configure.win") : sh not found
ERROR: configuration failed for package 'RCurl'
* removing 'C:/PROGRA~1/R/R-210~1.0/library/RCurl'
* restoring previous 'C:/PROGRA~1/R/R-210~1.0/library/RCurl'
The downloaded packages are in
‘C:\Users\Brock\AppData\Local\Temp\Rtmpc9wt5N\downloaded_packages’
Warning message:
In install.packages("RCurl", repos = "http://www.omegahat.org/R", :
installation of package 'RCurl' had non-zero exit status
Without going into details, I haven't been able to use the RGoogleAnalytics package as I get the same error that is found in this post. I simply am trying to exhaust every possible option to get around the error.
Any help or insight you can provide will be greatly appreciated!
The RCurl project page on CRAN says the Windows binary is not available. The ReadMe points you to a page maintained by Professor Ripley, where he provides binaries of RCurl and several other packages that have special build needs on Windows. However, he only provides them for the most recent major revision of R, so you would need to upgrade to R-2.12.0 to install them from his page.
If you want to build packages from source on Windows, you need to install Rtools first. It looks like you haven't done that. Even if you had them installed, it will still require extra steps to build RCurl on Windows... else the Windows binary would already be on CRAN.
Your best bet is probably to upgrade R and install RCurl from Prof. Ripley's page.
You are probably missing the components to build packages under Windows:
http://www.murdoch-sutherland.com/Rtools/
According to RCurl FAQ, either
curl-config is not found in your path
or
curl-config and related devlopment libraries (libcurl) are not installed.

Resources