A Simple and Flexible Switch-Case Construct for the 'R' Language
Overview
Provides a switch-case construct for 'R', as it is known from other programming languages. It allows to test multiple, similar conditions in an efficient, easy-to-read manner, so nested if-else constructs can be avoided. The switch-case construct is designed as an 'R' function that allows to return values depending on which condition is met and lets the programmer flexibly decide whether or not to leave the switch-case construct after a case block has been executed.
Bug fix
- Problem with character vectors in test expressions solved.
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-04
- NOTE12 OK, 1 NOTE2026-08-01
- OK12 OK2026-04-25
- NOTE11 OK, 3 NOTE2026-03-10
Documentation
- Help pages
- 2
- Examples that run
- 100%2 run in a plain check
- Exported functions with examples
- 100%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 0%
Downloads
Repository
- PRs merged (all time)
- 100%
- Median days to close, 50 most recently updated closed issues
- 1,273
- Median days to close, 50 most recently updated closed PRs
- 0
Stars over time
Issues over time
PRs over time
1 development-tooling and community-health practice detected across 1 family in the upstream repository
Checks run against github.com/jsugarelli/switchcase on 2026-10-21.
This repository shows signs of AI coding tools.
- Codexfirst seen 2025-06-20Pull request it wrote: opened by a project member
Dependencies
Installing switchcase adds no packages beyond those that come with R.
Code & Tests
People & History
Pick two releases to compare their code metrics.
- RR 4.6.0 released · 2026-04-24
- RR 4.5.0 released · 2025-04-11
- RR 4.4.0 released · 2024-04-24
- RR 4.3.0 released · 2023-04-21
- RR 4.2.0 released · 2022-04-22
- RR 4.1.0 released · 2021-05-18
- 0.1.1Latest
- 0.1.02020-05-08
- RR 4.0.0 released · 2020-04-24
Package metadata
- First published
- 2020-05-08
- Total releases
- 2 / 6 yrs
- License
- GPL-3 OSI
- Download size
- 4.8 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("switchcase")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-23, which the citation names so these numbers can be found later. More on citing and the projects behind them.