Skip to content

Commit

Permalink
Add docs for Preferences based R customization
Browse files Browse the repository at this point in the history
  • Loading branch information
frankier committed Aug 4, 2023
1 parent 6bf2c89 commit 20c3306
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions docs/src/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,27 @@ Pkg.add("RCall")

## Customizing the R installation

There are two ways to configure the R installation used by RCall.jl:

* [Using Julia's Preferences system](#Customizing-the-R-installation-using-Julia's-Preferences-system)
* [At install time, using the `R_HOME` environment variable](#Customizing-the-R-installation-at-install-time)

Should you experience problems with any of these methods, please [open an issue](https://github.com/JuliaStats/RCall.jl/issues/new).

### Customizing the R installation using Julia's Preferences system

In this case the appropriate paths are provided with RCall's `Rhome` and `libR` preferences. You can change these in different ways using [Julia's Preferences system](https://docs.julialang.org/en/v1/manual/code-loading/#preferences). For example, you can add the following to a `LocalPreferences.toml` file in the same directory as a project's `Project.toml` file:

```toml
[RCall]
Rhome = "/path/to/env/lib/R"
libR = "/path/to/env/lib/R/lib/libR.so"
```

When these preferences are set, they take precedence over the R installation configured at installation time.

### Customizing the R installation at install time

The RCall build script (run by `Pkg.add`)
will check for an existing R installation by looking in the following locations,
in order.
Expand All @@ -29,8 +50,6 @@ Pkg.build("RCall")

When `R_HOME` is set to `"*"`, RCall.jl will automatically install R for you using [Conda](https://github.com/JuliaPy/Conda.jl).

Should you experience problems with any of these methods, please [open an issue](https://github.com/JuliaStats/RCall.jl/issues/new).

## Standard installations

If you want to install R yourself, rather than relying on the automatic Conda installation, you can use one of the following options:
Expand Down

0 comments on commit 20c3306

Please sign in to comment.