Skip to content

switchr

0.14.8Package record

Installing, Managing, and Switching Between Distinct Sets of Installed Packages

0packages depend
3.8Kdownloads / year
18.0%test coverage
7/13flavors OK

Overview

About

Provides an abstraction for managing, installing, and switching between sets of installed R packages. This allows users to maintain multiple package libraries simultaneously, e.g. to maintain strict, package-version-specific reproducibility of many analyses, or work within a development/production release paradigm. Introduces a generalized package installation process which supports multiple repository and non-repository sources and tracks package provenance.

Install

Health

CRAN checks
4ERROR2NOTE7OK
Check messages
ERRORtestsr-devel-windows-x86_64, r-release-macos-arm64, r-release-macos-x86_64, r-release-windows-x86_64

r-devel-windows-x86_64, r-release-windows-x86_64

Running 'winpath.R' [7s]
Running the tests in 'tests/winpath.R' failed.
Complete output:
  > library(switchr)
  > ## if(getOption("repos")["CRAN"] == "@CRAN@")
  > ##     chooseCRANmirror(ind=1L)
  > graceful_inet(TRUE)
  $on
  [1] TRUE
  
  $silent
  [1] FALSE
  
  > checkUrlRoundtrip = function(pth) {
  +     pth = switchr:::normalizePath2(pth)
  +     furl = switchr:::makeFileURL(pth)
  +     pth2 = switchr:::fileFromFileURL(furl)
  +     if(pth != pth2)
  +         stop("Round trip result (", pth2, ") does not match original (", pth, ") when creating file URLs")
  + }
  > 
  > ## regression test to ensure that the roundtrip
  > ## between path and file url is working properly
  > checkUrlRoundtrip(getwd())
  > checkUrlRoundtrip(tempdir())
  > if(switchr:::isWindows())
  +     checkUrlRoundtrip("\\\\localhost\\c$")
  > 
  > ## regreossion test to ensure that package dependencies
  > ## are added to the dontunload list when a package
  > ## is specified
  > bef = switchrDontUnload()
  > af = switchrDontUnload("knitr")
  > stopifnot(all(tools::package_dependencies("knitr", recursive = TRUE)[[1]] %in% af))
  > 
  > 
  > ## regression test for unnecessary (and expensive)
  > ## lazy repo construction when install_packages
  > ## is passed urls for existing repos (the default
  > ## behavior).
  > tmplib = tempdir()
  > trace(lazyRepo, stop)
  Tracing function "lazyRepo" in environment <namespace:switchr>
  Warning: Tracing only in the namespace; to untrace you will need:
  untrace("lazyRepo", where = getNamespace("switchr"))
  [1] "lazyRepo"
  attr(,"package")
  [1] "switchr"
  > install_packages("switchr", repos = defaultRepos(), lib = tmplib)
  Error in rbind(avail1, avail2[new, ]) : 
    number of columns of matrices must match (see arg 2)
  Calls: install_packages ... install_packages -> install_packages -> .install_packages -> rbind
  Execution halted

r-release-macos-arm64

Running ‘winpath.R’ [1s/4s]
Running the tests in ‘tests/winpath.R’ failed.
Complete output:
  > library(switchr)
  > ## if(getOption("repos")["CRAN"] == "@CRAN@")
  > ##     chooseCRANmirror(ind=1L)
  > graceful_inet(TRUE)
  $on
  [1] TRUE
  
  $silent
  [1] FALSE
  
  > checkUrlRoundtrip = function(pth) {
  +     pth = switchr:::normalizePath2(pth)
  +     furl = switchr:::makeFileURL(pth)
  +     pth2 = switchr:::fileFromFileURL(furl)
  +     if(pth != pth2)
  +         stop("Round trip result (", pth2, ") does not match original (", pth, ") when creating file URLs")
  + }
  > 
  > ## regression test to ensure that the roundtrip
  > ## between path and file url is working properly
  > checkUrlRoundtrip(getwd())
  > checkUrlRoundtrip(tempdir())
  > if(switchr:::isWindows())
  +     checkUrlRoundtrip("\\\\localhost\\c$")
  > 
  > ## regreossion test to ensure that package dependencies
  > ## are added to the dontunload list when a package
  > ## is specified
  > bef = switchrDontUnload()
  > af = switchrDontUnload("knitr")
  > stopifnot(all(tools::package_dependencies("knitr", recursive = TRUE)[[1]] %in% af))
  > 
  > 
  > ## regression test for unnecessary (and expensive)
  > ## lazy repo construction when install_packages
  > ## is passed urls for existing repos (the default
  > ## behavior).
  > tmplib = tempdir()
  > trace(lazyRepo, stop)
  Tracing function "lazyRepo" in environment <namespace:switchr>
  Warning: Tracing only in the namespace; to untrace you will need:
  untrace("lazyRepo", where = getNamespace("switchr"))
  [1] "lazyRepo"
  attr(,"package")
  [1] "switchr"
  > install_packages("switchr", repos = defaultRepos(), lib = tmplib)
  Error in rbind(avail1, avail2[new, ]) : 
    number of columns of matrices must match (see arg 2)
  Calls: install_packages ... install_packages -> install_packages -> .install_packages -> rbind
  Execution halted

r-release-macos-x86_64

Running ‘winpath.R’ [4s/9s]
Running the tests in ‘tests/winpath.R’ failed.
Complete output:
  > library(switchr)
  > ## if(getOption("repos")["CRAN"] == "@CRAN@")
  > ##     chooseCRANmirror(ind=1L)
  > graceful_inet(TRUE)
  $on
  [1] TRUE
  
  $silent
  [1] FALSE
  
  > checkUrlRoundtrip = function(pth) {
  +     pth = switchr:::normalizePath2(pth)
  +     furl = switchr:::makeFileURL(pth)
  +     pth2 = switchr:::fileFromFileURL(furl)
  +     if(pth != pth2)
  +         stop("Round trip result (", pth2, ") does not match original (", pth, ") when creating file URLs")
  + }
  > 
  > ## regression test to ensure that the roundtrip
  > ## between path and file url is working properly
  > checkUrlRoundtrip(getwd())
  > checkUrlRoundtrip(tempdir())
  > if(switchr:::isWindows())
  +     checkUrlRoundtrip("\\\\localhost\\c$")
  > 
  > ## regreossion test to ensure that package dependencies
  > ## are added to the dontunload list when a package
  > ## is specified
  > bef = switchrDontUnload()
  > af = switchrDontUnload("knitr")
  > stopifnot(all(tools::package_dependencies("knitr", recursive = TRUE)[[1]] %in% af))
  > 
  > 
  > ## regression test for unnecessary (and expensive)
  > ## lazy repo construction when install_packages
  > ## is passed urls for existing repos (the default
  > ## behavior).
  > tmplib = tempdir()
  > trace(lazyRepo, stop)
  Tracing function "lazyRepo" in environment <namespace:switchr>
  Warning: Tracing only in the namespace; to untrace you will need:
  untrace("lazyRepo", where = getNamespace("switchr"))
  [1] "lazyRepo"
  attr(,"package")
  [1] "switchr"
  > install_packages("switchr", repos = defaultRepos(), lib = tmplib)
  Error in rbind(avail1, avail2[new, ]) : 
    number of columns of matrices must match (see arg 2)
  Calls: install_packages ... install_packages -> install_packages -> .install_packages -> rbind
  Execution halted
NOTECRAN incoming feasibilityr-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc
Maintainer: ‘Gabriel Becker <gabembecker@gmail.com>’

No Authors@R field in DESCRIPTION.
Please add one, modifying
  Authors@R: person(given = "Gabriel",
                    family = "Becker",
                    role = c("aut", "cre"),
                    email = "gabembecker@gmail.com")
as necessary.

CRAN check page ↗

Slowest check: 5.6 min · r-oldrel-windows-x86_64
Status changes
  • ERROR7 OK, 2 NOTE, 4 ERRORNow
  • ERROR11 OK, 2 NOTE, 1 ERROR2026-03-10
Advisories

none known

Documentation

In release 0.14.8
READMEYes · 47 wordsVignettesYes · 1 · dynamicNEWSYes · 100% structuredCitation fileYes · cites a publicationWebsitenot declared in DESCRIPTION
Cites a JSS article
Help pages
80
Examples that run
33%3 run in a plain check (1 of them under a condition) · 6 never run
Exported functions with examples
12%
Documented parameters
98%
Return-value docs
96%
Help pages citing references
8%
Vignettes (1)

Downloads

3.8K
CRAN downloads in the past year
Rank #12,071 · ~10/day · ~317/mo
Daily download trend is not available in this view yet.
39730 days
91290 days
3.8K1 year
Compare downloads with other packages →
Also on97 r2u8 autocran55 c2d4u

Repository

60Stars
6Forks
9Open issues
1Open PRs
0Releases
190Commits
7Commit identities
190 commits · Last activity 2023-02-23 · The default branch showed an older version (0.14.5.1) than CRAN on 2026-10-18
Responsiveness
How these are sampled
PRs merged (all time)
50%
Median days to close, 50 most recently updated closed issues
108
Median days to close, 50 most recently updated closed PRs
2

Stars over time

2025-08-17 · 602026-07-07 · 60
PracticesBeta

1 development-tooling and community-health practice detected across 1 family in the upstream repository

Checks run against github.com/gmbecker/switchr on 2026-10-18.

Continuous integration (1)
Travis CI (config file)
How this is detected·Detection ruleset v3 (2026-09-26)

Dependencies

Declared dependencies
3 external dependencies (excludes base and recommended)

Installing switchr adds 3 packages (3 with compiled code, 1.4 MB of source tarballs). Heaviest: RJSONIO 722 KB, RCurl 702 KB, bitops 11 KB.

Depends (1)
methods
Imports (3)
LinkingTo (0)
none
Suggests (1)
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

People & History

People (from the free-text Author field) (1)
Author, Maintainer since 0.9.3 (2015)
Releases (19)

Pick two releases to compare their code metrics.

  • R
    R 4.6.0 released · 2026-04-24
  • R
    R 4.5.0 released · 2025-04-11
  • R
    R 4.4.0 released · 2024-04-24
  • R
    R 4.3.0 released · 2023-04-21
  • unarchivedReturned to CRAN
    2023-03-21
  • 0.14.8Latest
    record
    2023-03-21 · current release · diff ↗
  • archivedRemoved from CRAN
    2023-03-01
    issues were not corrected despite reminders
  • R
    R 4.2.0 released · 2022-04-22
  • 0.14.5
    record
    2022-02-01 · diff ↗ ·
    added 1 export
    manifestFromCheckoutDir
  • R
    R 4.1.0 released · 2021-05-18
  • R
    R 4.0.0 released · 2020-04-24
  • 0.14.3
    record
    2020-04-20 · diff ↗
  • unarchivedReturned to CRAN
    2020-01-26
  • 0.14.2
    record
    2020-01-26 · diff ↗ ·
    added 2 exports
    graceful_inet, warning2
  • archivedRemoved from CRAN
    2020-01-22
    check issues were not corrected in time Tries to access cran.usthb.dz which fails from time to time
  • R
    R 3.6.0 released · 2019-04-26
Show 21 earlier eventsHide 21 earlier events
  • 0.13.5
    record
    2018-11-15 · diff ↗ ·
    added 3 exports
    findNewestPkgInds, findNewestPkgRows, update_PACKAGES
  • 0.13.0
    record
    2018-08-25 · diff ↗
  • R
    R 3.5.0 released · 2018-04-23
  • unarchivedReturned to CRAN
    2018-02-22
  • 0.12.7
    record
    2018-02-22 · diff ↗
  • archivedRemoved from CRAN
    2018-02-21
    check problems were not corrected despite reminders Unconditional use of Suggests package(s) from BioC Attempt to use defunct BioC 'extra' repository
  • 0.12.6
    record
    2017-11-07 · diff ↗
  • 0.12.5
    record
    2017-11-06 · diff ↗
  • R
    R 3.4.0 released · 2017-04-21
  • 0.11.2
    record
    2017-01-12 · diff ↗ ·
    removed 2 exports
    BiocDevel, BiocRelease
  • 0.11.0
    record
    2016-10-25 · diff ↗
  • 0.10.14
    record
    2016-05-22 · diff ↗
  • 0.10.13
    record
    2016-05-13 · diff ↗ ·
    removed 1 export
    Rcmd
    added 2 exports
    .libPaths2, nrow
  • R
    R 3.3.0 released · 2016-05-03
  • 0.9.19
    record
    2015-09-17 · diff ↗
  • 0.9.18
    record
    2015-09-02 · diff ↗ ·
    added 3 exports
    shell_timing<-, makePkgCheckout, shell_timing
  • 0.9.10
    record
    2015-07-02 · diff ↗ ·
    added 4 exports
    BiocSVNManifest, head, switchrNoUnload, tail
  • 0.9.6
    record
    2015-06-17 · diff ↗ ·
    added 2 exports
    fileFromFileURL, makeFileURL
  • 0.9.4
    record
    2015-06-06 · diff ↗
  • 0.9.3
    record
    2015-06-03
  • R
    R 3.2.0 released · 2015-04-16

Package metadata

First published
2015-06-03
Total releases
19 / 11 yrs
License
Artistic-2.0 OSI
Copyright
Genentech Inc
Download size
618 KB
Appears in task views

Cite

Cite this package

Run in R for the authors' entry:

citation("switchr")

The package provides a citation file, so citation() returns the authors' own entry.

It points to 10.18637/jss.v082.i01.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for switchr version 0.14.8 [Data set]. HJJB, LLC. Data release v2026-10-22. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-22, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy