https://github.com/klmr/switch-r
R version switcher for macOS
https://github.com/klmr/switch-r
r
Last synced: 5 months ago
JSON representation
R version switcher for macOS
- Host: GitHub
- URL: https://github.com/klmr/switch-r
- Owner: klmr
- License: mit
- Created: 2020-12-21T11:33:33.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2020-12-21T11:36:56.000Z (over 4 years ago)
- Last Synced: 2024-06-11T13:44:27.949Z (10 months ago)
- Topics: r
- Language: Shell
- Homepage:
- Size: 1.95 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- jimsghstars - klmr/switch-r - R version switcher for macOS (Shell)
README
# R version switcher for macOS
## Installation
```bash
mkdir -p ~/bin
curl -L https://raw.githubusercontent.com/klmr/switch-r/main/switch-r >~/bin/switch-r
chmod +x ~/bin/switch-r
```Next, ensure that `~/bin` is on your `PATH` — or copy the script to a location
that is.## Usage
```bash
⟩⟩⟩ switch-r --help
/Users/konrad/bin/switch-r [--list|--current|‹version›]⟩⟩⟩ switch-r -l # or --list
· 3.5
· 3.6
✔︎ 4.0
· 4.1
```switch-r only looks for R versions installed as a framework via the original
pkg, either from [r-project.org](https://r-project.org/), or via `brew install
--cask r`. Other installed versions of R are ignored.The script works by switching the `Current` symlink under
`/Library/Frameworks/R.framework/Versions/` to the specified framework version.
This requires that the R library path includes the R version (e.g. [by setting
`R_LIBS_USER` to contain
`%v`](https://stat.ethz.ch/R-manual/R-devel/library/base/html/libPaths.html)),
otherwise loading packages may not work.