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

I’m using Travis-CI to test a package aimed for Bioconductor: https://travis-ci.com/BUStools/BUSpaRse/jobs/210146459. 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 https://github.com/travis-ci/travis-build/blob/master/lib/travis/build/script/r.rb 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
jobs:
  include:
    - stage: prepare cache
      script: true
    - stage: test
r_github_packages:
  - BUStools/TENxBUSData

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