The editor has been updated to markdown! Please see more info at: Tutorial: Updated Support Site Editor

Question: Setting ExperimentHub Cache Location
gravatar for Mike Smith
11 months ago by
Mike Smith3.2k
EMBL Heidelberg / de.NBI
Mike Smith3.2k wrote:

What's the recommended way to set the cache location for ExperimentHub for every R session?

I don't have much space in $HOME, so at the moment I include the following in my .Rprofile

ExperimentHub::setExperimentHubOption('cache', '/place/with/space/ExHub')

For the most part this works nicely except that it also loads several other packages, including BiocInstaller and S4Vectors.  If I then run biocLite() at some point during the session and it tries to update any of these imported packages it will fail with something like:

Package ‘S4Vectors’ version 0.17.32 cannot be unloaded:
Error in unloadNamespace(package)

I then resort to starting a new R --vanilla session to run the installation, and then switch back, but this is also a pain as .Rprofile specifies the location of my library path too.  S4Vectors in particular seems to be changing a lot in devel and I end up having to do this pretty regularly, so I was just wondering if there is some mechanism for setting the cache location without loading those packages until I want to.

experimenthub • 286 views
ADD COMMENTlink modified 11 months ago by Martin Morgan ♦♦ 22k • written 11 months ago by Mike Smith3.2k
Answer: Setting ExperimentHub Cache Location
gravatar for Martin Morgan
11 months ago by
Martin Morgan ♦♦ 22k
United States
Martin Morgan ♦♦ 22k wrote:

Remove the .Rprofile setting and use the a global option or environment variable EXPERIMENT_HUB_CACHE; see ?getExperimentHubOption

     Default values may also be determined by system and global R
     environment variables visible _before_ the package is loaded. Use
     options or variables preceded by "EXPERIMENT_HUB_", e.g.,
     'options(EXPERIMENT_HUB_MAX_DOWNLOADS=10)' prior to package load
     sets the default number of downloads to 10.


ADD COMMENTlink modified 11 months ago • written 11 months ago by Martin Morgan ♦♦ 22k

That works great, thanks.

FYI there are references to getExperimentHubCache and setExperimentHubCache in the Description section of ?getExperimentHub that I'm not sure are valid anymore.

ADD REPLYlink written 11 months ago by Mike Smith3.2k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 385 users visited in the last hour