Bioconductor update keeps failing to update after a half hour - r

I'm working with R and need to install some packages.
> BiocManager::install( c( list, of, packages) )
Error: Bioconductor version '3.13' requires R version '4.1'; use
`BiocManager::install(version = '3.16')` with R version 4.2; see
https://bioconductor.org/install
ok, so I need to update bioconductor. No problem:
BiocManager::install(version = '3.16')
At this point I get an absolute torrent of text output to my terminal for over half an hour. It ends with this:
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (ggpubr)
The downloaded source packages are in
‘/tmp/Rtmpu3HGq9/downloaded_packages’
Error in .install_github(todo, lib = lib, lib.loc = lib.loc, repos = repos, :
argument "update" is missing, with no default
In addition: Warning message:
package(s) not installed when version(s) same as or greater than current; use
`force = TRUE` to re-install: 'BiocVersion'
So I do it again with the "force" option, but the process insists on starting all over again from scratch, so I have to wait another half-hour and get the same problem. I've done this almost a dozen times now with variations on the command and environment settings and this is eating up days of work time.
I also noticed another message in the output:
Warning: unable to access index for repository https://bioconductor.org/packages/3.16/bioc/src/contrib:
cannot open URL 'https://bioconductor.org/packages/3.16/bioc/src/contrib/PACKAGES'
Am I being blocked by some internal network? I've also tried setting a proxy with Sys.setenv(http_proxy="[proxyAddress]:[port]")
To no avail.
I'm Running out of ideas and would much appreciate any help.

This issue is discussed here: https://github.com/Bioconductor/BiocManager/issues/142. Basically it will be fixed in the next release of BiocManager, which is whatever comes after 1.30.19.

Related

RStudio - Not able to install packages after reinstallation of R & constant working directory issues

I recently had to have a new laptop build at work and therefore reinstalled R and R Studio through a designated 'Company Portal' that did the software installation for me (this might be the problem). When now trying to install and load packages for use, I am running in to the below error for packages (in this case for tidyverse):
Warning message: In options(stringsAsFactors = TRUE) :
'options(stringsAsFactors = TRUE)' is deprecated and will be
disabled Error in setwd("C:/R/WorkingDir") : cannot change working
directory Execution halted Warning in install.packages :
installation of package ‘tidyselect’ had non-zero exit status
I also had this error when I first loaded R up that seems to be reappearing due any attempt to install packages:
Error in setwd("C:/R/WorkingDir") :
cannot change working directory
I've never had this issue before using RStudio across numerous machines and software versions, can anyone advise what is going on? My name (and thus C:\ user file path(s)) does have an apostrophe in it, if that matters - but it has never been an issue before. Is some key installation setting now misaligned and if yes, can anyone advise how to resolve?

make not found when using dynr [duplicate]

The R Package ConvCalendar is not on Cran repository anymore (see here).
However, because I have intensively used this package for previous projects, it would be nice to have it installed on my machine, even an older version would suffice.
(Windows 10 environment)
In the link above it is possible to download older versions of ConvCalendar from the archive. I thus did it, and tried installing it by running (having devtools also installed and loaded):
install.packages("ConvCalendar_1.2.tar.gz", repos=NULL, type="source")
However, I get the following error message:
> install.packages("ConvCalendar_1.0.tar.gz", repos=NULL, type="source")
Installing package into ‘C:/Users/myname/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
* installing *source* package 'ConvCalendar' ...
** libs
*** arch - i386
Warning in system(cmd) : 'make' not found
ERROR: compilation failed for package 'ConvCalendar'
* removing 'C:/Users/myname/Documents/R/win-library/3.5/ConvCalendar'
In R CMD INSTALL
Warning in install.packages :
installation of package ‘ConvCalendar_1.2.tar.gz’ had non-zero exit status
Looking for a solution to this problem.
what do you need is to update the Rtool, here is the link I had the same issue before once you update it will work.
Reinstall Rtools, Please check the below link to figure out the right version of Rtools.
https://cran.r-project.org/bin/windows/Rtools/history.html
'make' not found is a pretty clear cut message on what's the issue, and as noted here and elsewhere it is caused by Rterm not knowing where to find it (unlike other tools like RStudio, base R is completely clueless about the Windows registry value where the Rtools path gets set by default).
Up to Rtools 3.5 this could be neatly avoided with a checkbox in the installer (which took care of adding the right directory to PATH), but newer versions dropped it. Presumably to focus on the RTOOLS_HOME variable (which is far more independent and resilient to whatever else you may have installed on your system), if just so it wasn't that until R 4.2 nothing really cared for it in the code.
On top of that, it's only since Rtools 4.0 (maybe because they updated the old MSYS2/Cygwin environment, or maybe it was something in the accompanying R 4.0?) that you can use long filenames with spaces to point to the folder containing make. Also, hopefully you haven't been manually setting BINPREF anywhere.
TL;DR: just add something like "C:\rtools40\usr\bin" (or whatever you have) to your PATH.
Building on #mirh's answer.
I had installed Rtools 4.0 in the in "C:\rtools" on windows and had the "'make' not found" issue (I also had a warning that RTools was not found). I could not change the PATH through the traditional route though because I was missing admin rights. The following helped:
Add to your .RProfile the line:
Sys.setenv(PATH = paste0(Sys.getenv("PATH"), ";C:\\rtools40\\usr\\bin"))
This will change the path from within R for the current session. You might have to alter it if you have a different version of RTools or a different installation directory.
After this I can install from source and I don't get the RTools warning anymore.

Having issues installing an R package from Github

Please be patient with me as I'm a total noob, but I'm really trying to learn.
I'm trying to make a choropleth map for my country, and found an R package on Github that handles it excellently. However, I'm working on a university computer and I don't have write privileges on any drive but M://, so whenever the package tries to install on C:// it obviously throws an error. This hasn't been a problem since I can just specify a libpath as an argument on install.packages, but devtools::install_github does not seem to have such an argument.
I tried using
with_libpaths(new = "M:\R\win-library\3.2", install_github('diegovalle/mxmaps'))
But I got an error message saying
with_libpaths' is deprecated. Use 'withr::with_libpaths' instead.
I take this to mean that I need to install the "withr" package in order to use that? However, I keep getting errors when trying to install that package. First, I got
Warning in install.packages : installation of package ‘withr’ had
non-zero exit status
because of the not having access to C:// issue. I usually bypass this by installing directly from the binaries, but when I try that it tells me
"Warning in install.packages : package ‘withr’ is not available (for R
version 3.2.2)".
Other than updating my version of R (which will be a nighmare since I don't have installation privileges on this machine), how else can I either install withr or find another way to specify the directory to install the package from github?
I would suggest you to go with latest version of 3.4.All above mentioned packages are available under latest version.
Two ways to set local library paths (at least on Linux running R 3.5.3):
(1) At the beginning of your script, set the the .libPaths option to your local library path, i.e.: .libPaths("M:\R\win-library\3.2")
(2) Add to your .Renviron file a line that specifies your local library path: i.e.: R_LIBS="M:\R\win-library\3.2"
Note: For (1) You will need to manually run every time you start a new R session, whereas (2) will be set automatically when R starts.

Is the bigvis package for R not available for R version 3.0.1?

I'm developing an app designed to handle big data and was having problems graphing the data in a useful way because of the sheer amount of plot points. My initial idea was to create a little algorithm that, based on the size of the data, divides the data points into about 30 subsets and takes the average of all the points in these subsets (what are the faults of this implementation by the way)?
Then I learned about bigVis, which does a lot of the big data representation for you, and I really want to try this library out.
I have a problem installing it. I've done:
>install_github("devtools")
>install.packages("bigVis")
Warning in install.packages :
package ‘bigVis’ is not available (for R version 3.0.1)
I've also done:
>install_github("devtools")
>devtools::install_github("bigvis")
* installing *source* package 'bigvis' ...
** libs
*** arch - i386
ERROR: compilation failed for package 'bigvis'
* removing 'C:/Program Files/R/R-3.0.1/library/bigvis'
Error: Command failed (1)
Does anyone know what this error is?
Thanks
assuming you've got Rtools.exe installed, here are the steps to get bigvis installed if it still does not work. you need a 64-bit compiler in order to run the Rcpp package, one of the dependencies of bigvis
in R, confirm g++ isn't installed (or isn't 64-bit)
Sys.which( "g++" )
download mingw-w64 - http://sourceforge.net/projects/mingw-w64/ (Since the mingw-w64 project on sourceforge.net is moving to mingw-w64.org i suggest to use mingw-w64.org)
when the mingw-w64 installer pops up, be sure to change the architecture row from i686 to x86_64 then let it install
in the windows start menu search bar, type environment and an option edit the system environment variables should pop up. click it.
edit your PATH and add a semicolon plus the folder name of the bin directory of the mingw-w64 program that you just installed. for me, it was ;C:\Program Files\mingw-w64\x86_64-4.9.0-posix-seh-rt_v3-rev2\mingw64\bin but this will change for future versions
close & re-open R and Sys.which('g++') should now indicate the mingw-x64 directory
Sys.which('g++')
"C:\PROGRA~1\MINGW-~1\X86_64~1.0-P\mingw64\bin\G__~1.EXE"
devtools:::install_github("hadley/bigvis") should now complete successfully
This works for me, using R v 3.0.1 on Windows 7.
Directly download the current package from GitHub:
download.file("https://github.com/hadley/bigvis/archive/master.zip", destfile = "bigvis.zip")
Unzip it, just so that we leave nothing to chance (though you could use the .zip itself):
unzip("bigvis.zip")
and install from source:
install.packages("bigvis-master", repos = NULL, type = "source")`

Did the subdirectory structure of package repositories change as of R 2.15.2?

Kind of embarrassing / a no-go, but since it hasn't been that long that I've moved from "pure user" to "beginner-developer", I've never actually read the CHANGELOG when a new R version came out - well until today (and I have the feeling I should make this a habbit) ;-)
Yet I'm not sure if the supposed change actually occurred since I couldn't find anything about it at a first glimpse at the CHANGELOG of R R 2.15.2:
Actual question
Is it possible that the (subdirectory) structure of package repositories changed from
./bin/windows/contrib/2.xx/
to
./src/contrib/2.xx/ or even ./src/contrib?
Or at least that the PACKAGES file now needs to live here: ./src/contrib/PACKAGES?
Background info
Up to version 2.15.1, the following path worked to install packages from my local package repository:
path.repos <- "L:/R/packages"
repos <- file.path("file://", path.repos)
Function contrib.url would take repos and expand it to the right subdirectory:
> contrib.url(repos)
[1] "file:///L:/R/packages/bin/windows/contrib/2.15"
But when I try to run install.packages(), I get the following error for R 2.15.2:
> install.packages("mypkg",
+ lib=file.path(R.home(), "library"),
+ repos=repos,
+ type="win.binary"
+ )
Error in read.dcf(file = tmpf) : cannot open the connection
In addition: Warning message:
In read.dcf(file = tmpf) :
cannot open compressed file 'L:/R/packages/src/contrib/PACKAGES', probable reason 'No such file or directory'
>
When I do the same with R 2.15.1, everything works smoothly.
Due dilligence
There are some references with respect to repositories in the CHANGELOG, but the only section I found that gives me some evidence that the supposed change occurred is this:
PACKAGE INSTALLATION
For a Windows or Mac OS X binary package install, install.packages() will check if a source package is available on the same repositories, and report if it is a later version or there is a source package but no binary package available.
Just had a look at the official documentation again and got the idea that maybe arg type is not passed along to contrib.url() correctly as it seems to me install.package() is looking at the place for type="source" packages?
This particular bug isn't the same as mine.
This issue relates to checks install.packages() now runs before installing. As Rappster said, it tries to find a source package to compare the binary version with:
For a Windows or Mac OS X binary package install, install.packages() will check if a source package is available on the same repositories, and report if it is a later version or there is a source package but no binary package available.
So a simple way of squashing this message is creating the R/src/contrib directory and running tools::write_PACKAGES() in that directory to create (an empty) PACKAGES file.
And of course, the reason you aren't getting this message in 2.15.1 is that it doesn't do the checking (see R NEWS quote above) that 2.15.2 performs.
I have submitted a bug report of my issues. No news yet. May post it to the R mailing list as well.

Resources