Is there a way not to install R packages suggested by dependencies?

I’m using Travis-CI to test a package aimed for Bioconductor: The package passed R CMD check and BiocCheck locally, but on Travis, the time limit of 50 minutes was exceeded. The vast majority of time spent was to install dependencies, but I found that many packages installed, such as edgeR, are never used in my package, but are suggested by Bioconductor dependencies of my package, such as plyranges, which depends on GenomicRanges, which suggests a lot of packages. I didn’t install some of those suggested packages locally and nothing went wrong, so I don’t think I need those packages.

So my question is, can I skip installing packages suggested by dependencies? If that’s possible, then the actual R CMD check can finish before the time limit is exceeded.

I don’t see any options in BiocManager documentation to skip “recommended” packages when installing. If you know a way, you can submit a pull request to that would add such an option.

Otherwise, to prevent the job from timing out, use a preliminary stage to warm up the cache.

It worked. The .travis.yml file is:

language: R
r: bioc-devel
bioc_check: true
sudo: false
cache: packages
    - stage: prepare cache
      script: true
    - stage: test
  - BUStools/TENxBUSData

  # ensure bioc-devel is being used
  - R -e 'BiocManager::install(version = "devel", ask=FALSE)'
  - R -e 'BiocManager::valid()'