/* see https://github.com/w3c/csswg-drafts/issues/4434 */
float: right;
}
}
.toc-content {
padding-left: 30px;
@ -376,8 +382,9 @@ div.tocify {
<h2>Credits</h2>
<p>Many thanks to the following folks for their contributions to the project to help make RSwitch better for everyone:</p>
<ul>
<li><ahref="https://github.com/guiastrennec">Benjamin Guiastrennec</a> for suggesting improvements to the documentation regarding how to use the installer packages from the <ahref="https://mac.r-project.org/">R for macOS Developer’s Page</a> without clobbering existing R Framework installs.</li>
<li><ahref="https://github.com/guiastrennec">Benjamin Guiastrennec</a> for suggesting improvements to the documentation regarding how to use the installer packages from the <ahref="https://mac.r-project.org/">R for macOS Developer’s Page</a> without clobbering existing R Framework installs and also for encouraging support for RStudio Sever file uploads and exports.</li>
<li><ahref="https://github.com/xvrdm">Xavier Adam</a> for <ahref="https://github.com/hrbrmstr/RSwitch/pull/4">adding books to the RSwitch library</a>.</li>
<li><ahref="https://github.com/pat-s">Patrick Schratz</a> for encourging the development of a command-line switcher to make it easier to use in automation (and sans mouse).</li>
</ul>
</div>
<divid="basiccore-usage"class="section level2">
@ -391,6 +398,8 @@ div.tocify {
├── 3.5
├── 3.6
├── 3.7
├── 4.0
├── 4.1
└── Current</code></pre>
<p>The “R Framework” is, well, <em>R</em> on your macOS system. All of the necessary supporting libraries, code, pacakges, configuration elements, etc. exist in the framework directory. Here is the top-level contents of the <code>3.5</code> version of the R Framework:</p>
<p>For the most control, you can install a coexisting version of R <strong>oldrel</strong>-1, <strong>oldrel</strong> (as of the date this document was created those would be R 3.4 and R 3.5), current <strong>release</strong> (R 3.6) and <strong>devel</strong> (3.7) by hand by going to the<ahref="https://mac.r-project.org/">R for macOS Developer’s Page</a> and downloading the <code>tar.gz</code> version of those distributions:</p>
<p>For the most control, you can install a coexisting version of R <strong>oldrel</strong>-1, <strong>oldrel</strong> (as of the date this document was created those would be R 3.5 and R 3.6), current <strong>release</strong> (R 4.0) and <strong>devel</strong> (4.1) by hand by going to<ahref="https://mac.r-project.org/">R for macOS</a> and downloading the <code>tar.gz</code> version of those distributions:</p>
<p><imgsrc="r-macos-downloads.png"/></p>
<p>Here are direct <code>https</code> links to the tarballs:</p>
<p>Once downloaded, you can fire up a terminal prompt, head to the root directory (i.e. <code>cd /</code>) and run <code>tar -xvzf path-to-thing-you-just-downloaded</code> to lay out the contents of the tarball onto the filesystem. You can also use the <code>.pkg</code> versions if you prefer a clicky-installer wizard, but these installers will remove any previous versions of the framework (kinda defeating the purpose). You can still use the <code>.pkg</code> format by heading over to the command line and using <code>pkgutil --forget</code> to prevent said clobbering behavior (as noted in <ahref="https://cran.rstudio.org/doc/manuals/R-admin.html#Uninstalling-under-macOS">Section 4.2</a> of <em>R Installation and Administration</em>. For example:</p>
<h2>Getting Help or Resources from the Internet</h2>
<p>Since RSwitch is designed to help you work with R on macOS it seemed only fitting to provide some handy links to resources like the R for macOS page, the CRAN R page, RStudio dailies link, etc. They’re all available via the fairly obvious sub-menu:</p>
<p>This allows you to keep RStudio Server work separate from your internet browsing, creating a more focused workspace that you never have to worry about accidentally closing. Window size & position are preserved across launches, too.</p>
<p>This allows you to keep RStudio Server work separate from your internet browsing, creating a more focused workspace that you never have to worry about accidentally closing. Window size & position are preserved across launches, too and the keystrokes you are used to in RStudio Desktop on macOS are the same in this task-specific browser.</p>
<p>File uploads and downloads (“exports”) are also now supported.</p>
</div>
<divid="have-it-your-way"class="section level2">
<h2>Have It Your Way</h2>
<p>There’s a new minimal preferences system for showing/hiding the dock icon and for enabling background checks for and notifications when new RStudio Dailies are available:</p>
<p><imgsrc="rswitch-1.5.0-prefs.png"/></p>
<p>There’s a minimal preferences system for showing/hiding the dock icon and for enabling background checks for and notifications when new RStudio Dailies are available.</p>
<p><imgsrc="rswitch-prefs.png"/></p>
<p>Another (new) preference is “Ensure RStudio opens R/Rmd files”. Xcode and other developer-oriented programs seem to love to takeover either <code>.R</code> and <code>.Rmd</code> (sometimes both) and loading Xcode can take a while. Setting this preference will enable an hourly check for who owns those extensions and forces them back to RStudio in the event they are changed.</p>
</div>
<divid="always-on"class="section level2">
<h2>Always On</h2>
<p>If you like RSwitch enough to keep it running all the time, just drag the item to the “Login Items” table of your user in the “Users & Groups” pane of “System Preferences”</p>
<p>There’s a new command-line switcher for folks who would rather not interact with a menu to change R versions. <code>RSwitch.app</code> comes with <code>rswitch-cmd</code> tucked into <code>/Applications/RSwitch.app/Contents/Resources/</code>. You can make it easier to type by making a symbolic link in <code>/usr/local/bin/</code> (or your preferred path that’s on <code>$PATH</code>):</p>
<p>Firing off just <code>rswitch</code> will bring up a list of available R installs with an asterisk signifying which one is active:</p>
<preclass="shell"><code>$ rswitch
2.14 (incomplete)
3.5
3.6
3.7
4.0 *
4.1</code></pre>
<p>Just call it with the version you want to switch to and you are ready to go (you can also use <code>--list</code> or <code>-l</code> if you like typing more than you need to):</p>
<preclass="shell"><code>$ rswitch 4.1
$ rswitch --list
2.14 (incomplete)
3.5
3.6
3.7
4.0
4.1 *</code></pre>
<p>You’ll receive an error message if the version specified cannot be found:</p>
<preclass="shell"><code>$ rswitch 4.4
R version 4.4 not found.</code></pre>
<p>All non-successful operations will set a non-zero exit code in the event you are using the command-line utility in scripts.</p>
</div>
<divid="getting-help"class="section level2">
<h2>Getting Help</h2>
<p>If you’re having trouble with RSwitch or have a feature request, head on over to any of the following social coding sites and file an issue:</p>
@ -17,8 +17,9 @@ RSwitch is a macOS menubar application that works on macOS 10.14+ and provides h
Many thanks to the following folks for their contributions to the project to help make RSwitch better for everyone:
- [Benjamin Guiastrennec](https://github.com/guiastrennec) for suggesting improvements to the documentation regarding how to use the installer packages from the [R for macOS Developer's Page](https://mac.r-project.org/) without clobbering existing R Framework installs.
- [Benjamin Guiastrennec](https://github.com/guiastrennec) for suggesting improvements to the documentation regarding how to use the installer packages from the [R for macOS Developer's Page](https://mac.r-project.org/) without clobbering existing R Framework installs and also for encouraging support for RStudio Sever file uploads and exports.
- [Xavier Adam](https://github.com/xvrdm) for [adding books to the RSwitch library](https://github.com/hrbrmstr/RSwitch/pull/4).
- [Patrick Schratz](https://github.com/pat-s) for encourging the development of a command-line switcher to make it easier to use in automation (and sans mouse).
## Basic/Core Usage
@ -57,14 +58,14 @@ For the most control, you can install a coexisting version of R **oldrel**-1, **
Once downloaded, you can fire up a terminal prompt, head to the root directory (i.e. `cd /`) and run `tar -xvzf path-to-thing-you-just-downloaded` to lay out the contents of the tarball onto the filesystem. You can also use the `.pkg` versions if you prefer a clicky-installer wizard, but these installers will remove any previous versions of the framework (kinda defeating the purpose). You can still use the `.pkg` format by heading over to the command line and using `pkgutil --forget` to prevent said clobbering behavior (as noted in [Section 4.2](https://cran.rstudio.org/doc/manuals/R-admin.html#Uninstalling-under-macOS) of _R Installation and Administration_. For example:
sudo pkgutil --forget org.r-project.R.el-capitan.fw.pkg \ # may need to use high-sierra vs el-capitan
--forget org.r-project.x86_64.tcltk.x11 \
--forget org.r-project.x86_64.texinfo \
--forget org.r-project.R.el-capitan.GUI.pkg
@ -100,7 +101,7 @@ and the Finder will open up to `~/Downloads` with the target file selected.
Since RSwitch is designed to help you work with R on macOS it seemed only fitting to provide some handy links to resources like the R for macOS page, the CRAN R page, RStudio dailies link, etc. They're all available via the fairly obvious sub-menu:


and each item will open up in your default web browser. (File an issue if you'd like more links added)
@ -138,13 +139,17 @@ and you can then launch a task-specific browser for each instance you have defin

This allows you to keep RStudio Server work separate from your internet browsing, creating a more focused workspace that you never have to worry about accidentally closing. Window size & position are preserved across launches, too.
This allows you to keep RStudio Server work separate from your internet browsing, creating a more focused workspace that you never have to worry about accidentally closing. Window size & position are preserved across launches, too and the keystrokes you are used to in RStudio Desktop on macOS are the same in this task-specific browser.
File uploads and downloads ("exports") are also now supported.
## Have It Your Way
There's a new minimal preferences system for showing/hiding the dock icon and for enabling background checks for and notifications when new RStudio Dailies are available:
There's a minimal preferences system for showing/hiding the dock icon and for enabling background checks for and notifications when new RStudio Dailies are available.


Another (new) preference is "Ensure RStudio opens R/Rmd files". Xcode and other developer-oriented programs seem to love to takeover either `.R` and `.Rmd` (sometimes both) and loading Xcode can take a while. Setting this preference will enable an hourly check for who owns those extensions and forces them back to RStudio in the event they are changed.
## Always On
@ -152,6 +157,48 @@ If you like RSwitch enough to keep it running all the time, just drag the item t

## Taking Command(line)
There's a new command-line switcher for folks who would rather not interact with a menu to change R versions. `RSwitch.app` comes with `rswitch-cmd` tucked into `/Applications/RSwitch.app/Contents/Resources/`. You can make it easier to type by making a symbolic link in `/usr/local/bin/` (or your preferred path that's on `$PATH`):
Firing off just `rswitch` will bring up a list of available R installs with an asterisk signifying which one is active:
```shell
$ rswitch
2.14 (incomplete)
3.5
3.6
3.7
4.0 *
4.1
```
Just call it with the version you want to switch to and you are ready to go (you can also use `--list` or `-l` if you like typing more than you need to):
```shell
$ rswitch 4.1
$ rswitch --list
2.14 (incomplete)
3.5
3.6
3.7
4.0
4.1 *
```
You'll receive an error message if the version specified cannot be found:
```shell
$ rswitch 4.4
R version 4.4 not found.
```
All non-successful operations will set a non-zero exit code in the event you are using the command-line utility in scripts.
## Getting Help
If you're having trouble with RSwitch or have a feature request, head on over to any of the following social coding sites and file an issue: