Skip to content

Commit

Permalink
sub-shell -> subshell
Browse files Browse the repository at this point in the history
  • Loading branch information
philipp-baumann committed Jan 22, 2024
1 parent 8a94aaa commit 9b539f4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -269,16 +269,16 @@ read the [Interactive
use](https://b-rodrigues.github.io/rix/articles/interactive-use.html) vignette.


### Running single functions in a sub-shell
### Running single functions in a subshell

It is also possible to run single functions in an isolated environment from an
active R session using `with_nix()` and get the output of that function loaded
into the current session. Refer to [this
vignette](https://b-rodrigues.github.io/rix/articles/running-r-or-shell-code-in-nix-from-r.html)
for more details on how to achieve this. Concretely this means that you could be
running R version 4.3.2 (installed via Nix, or not), and execute a function on R
version 4.0.0 for example in a sub-shell (or execute a function that requires an
old version of a package in that sub-shell), and get the result of the
version 4.0.0 for example in a subshell (or execute a function that requires an
old version of a package in that subshell), and get the result of the
computation back into the main R session.

### Running programs from an environment
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
- [rix workflow](#rix-workflow)
- [default.nix](#defaultnix)
- [Running single functions in a
sub-shell](#running-single-functions-in-a-sub-shell)
subshell](#running-single-functions-in-a-subshell)
- [Running programs from an
environment](#running-programs-from-an-environment)
- [Installation](#installation)
Expand Down Expand Up @@ -283,17 +283,17 @@ interactively, read the [Interactive
use](https://b-rodrigues.github.io/rix/articles/interactive-use.html)
vignette.

### Running single functions in a sub-shell
### Running single functions in a subshell

It is also possible to run single functions in an isolated environment
from an active R session using `with_nix()` and get the output of that
function loaded into the current session. Refer to [this
vignette](https://b-rodrigues.github.io/rix/articles/running-r-or-shell-code-in-nix-from-r.html)
for more details on how to achieve this. Concretely this means that you
could be running R version 4.3.2 (installed via Nix, or not), and
execute a function on R version 4.0.0 for example in a sub-shell (or
execute a function on R version 4.0.0 for example in a subshell (or
execute a function that requires an old version of a package in that
sub-shell), and get the result of the computation back into the main R
subshell), and get the result of the computation back into the main R
session.

### Running programs from an environment
Expand Down
4 changes: 2 additions & 2 deletions dev/running_r_or_shell_code_in_nix_from_r.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -375,12 +375,12 @@ Here are the last few lines printed on screen:
[1] "a"
```

Not only do we see the result of evaluating the code in the sub-shell, we also
Not only do we see the result of evaluating the code in the subshell, we also
have access to it: `out_nix_stringr` holds this result.

We can now compare the two: the result of the code running in our main session
with the latest version of `{stringr}` and the result of the code running in the
sub-shell with the old version of `{stringr}`:
subshell with the old version of `{stringr}`:

```{r, eval=FALSE}
identical(out_system_stringr, out_nix_stringr)
Expand Down
6 changes: 3 additions & 3 deletions vignettes/running-r-or-shell-code-in-nix-from-r.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ This is is different for R versions 4.1.3 and below, where you should get an
identical data frame back.


### Run functioned up code and investigate results produced in pure Nix R software environments
### Run functioned up code and investigate results produced in pure Nix Rsoftware environments

To formally validate in a 'System-to-Nix' approach that the object returned from
`as.vector.data.frame()` is before `R` \< 4.2.0, we define a function that runs
Expand Down Expand Up @@ -414,12 +414,12 @@ Here are the last few lines printed on screen:
[1] "a"
```

Not only do we see the result of evaluating the code in the sub-shell, we also
Not only do we see the result of evaluating the code in the subshell, we also
have access to it: `out_nix_stringr` holds this result.

We can now compare the two: the result of the code running in our main session
with the latest version of `{stringr}` and the result of the code running in the
sub-shell with the old version of `{stringr}`:
subshell with the old version of `{stringr}`:


```{r eval = FALSE}
Expand Down

0 comments on commit 9b539f4

Please sign in to comment.