You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<ahref="https://www.paypal.me/randy3k/5usd"title="Donate to this project using Paypal"><imgsrc="https://img.shields.io/badge/paypal-donate-blue.svg" /></a>
8
8
9
-
10
9
<imgsrc="radian.png"></img>
11
10
12
11
_radian_ is an alternative console for the R program with multiline editing and rich syntax highlight.
13
12
One would consider _radian_ as a [ipython](https://github.com/ipython/ipython) clone for R, though its design is more aligned to [julia](https://julialang.org).
- cross platform, runs on Windows, macOS and Linux
21
19
- shell mode: hit `;` to enter and `<backspace>` to leave
22
20
- reticulate python repl mode: hit `~` to enter
23
21
- improved R prompt and reticulate python prompt
24
-
- multiline editing
25
-
- syntax highlight
26
-
- auto completion (reticulate autocompletion depends on `jedi`)
22
+
- multiline editing
23
+
- syntax highlight
24
+
- auto completion (reticulate autocompletion depends on `jedi`)
27
25
- unicode support
28
26
- latex completion
29
27
- auto matching parens/quotes.
@@ -32,44 +30,34 @@ One would consider _radian_ as a [ipython](https://github.com/ipython/ipython) c
32
30
- automatically adjust to terminal width
33
31
- read more than 4096 bytes per line
34
32
35
-
36
33
## Installation
37
34
38
35
Requirements:
39
36
40
-
- An installation of R (version 3.4.0 or above) is required to use _radian_, an R installation binary for your system can be downloaded from https://cran.r-project.org.
41
-
-`python` (version 3.7 or above) is also required to install _radian_. If your system doesn't come with a python distribution, it can be downloaded from https://www.python.org/downloads/ or https://conda.io/en/latest/miniconda.html.
42
-
-`pip` is optional but it makes the installation a bit easier.
37
+
- An installation of R (version 3.4.0 or above) is required to use _radian_, an R installation binary for your system can be downloaded from <https://cran.r-project.org>.
38
+
-`python` (version 3.8 or above) is also required to install _radian_. If your system doesn't come with a python distribution, it can be downloaded from <https://www.python.org/downloads/>.
39
+
-Installing `radian` via [`pipx`](https://pipx.pypa.io/stable/installation/) would be the easiest option.
In this case, it is recommended to install R via conda to ensure consistency in C runtime libraries.
61
-
62
50
## Alias on unix system
63
51
64
52
You could alias `r` to _radian_ by putting
65
53
66
54
```bash
67
55
alias r="radian"
68
56
```
57
+
69
58
in `~/.bash_profile` such that `r` would open _radian_ and `R` would still open the traditional R console.
70
59
(`R` is still useful, e.g, running `R CMD BUILD`.)
71
60
72
-
73
61
## Settings
74
62
75
63
_radian_ can be customized by specifying the below options in various locations
@@ -81,12 +69,11 @@ _radian_ can be customized by specifying the below options in various locations
81
69
-`.radian_profile` in the working directory
82
70
83
71
The options could be also specified in the `.Rprofile` files, however,
84
-
it is not recommended because
72
+
it is not recommended because
85
73
86
74
1. the settings are not persistent when vanilla mode is used;
87
75
2. it doesn't work well with `packrat` or `renv`.
88
76
89
-
90
77
```r
91
78
# Do not copy the whole configuration, just specify what you need!
92
79
# see https://pygments.org/styles
@@ -182,40 +169,39 @@ options(
182
169
183
170
## FAQ
184
171
185
-
#### Unicode doesn't work in Windows and R 4.2+.
186
-
187
-
The latest version of R supports Unicode codepage directly. However, radian relies on Python and Python doesn't support Unicode in the way that R supports it. A workaround could be found here: https://github.com/randy3k/radian/issues/269#issuecomment-1169663251. Though it may break the ploting device (running `plot()` will kill radian).
172
+
#### Unicode doesn't work in Windows and R 4.2+
188
173
174
+
The latest version of R supports Unicode codepage directly. However, radian relies on Python and Python doesn't support Unicode in the way that R supports it. A workaround could be found here: <https://github.com/randy3k/radian/issues/269#issuecomment-1169663251>. Though it may break the ploting device (running `plot()` will kill radian).
189
175
190
-
#### I can't specify python runtime in reticulate.
176
+
#### I can't specify python runtime in reticulate
191
177
192
-
It is expected. `radian` runs on python and the python runtime used by radian is forced in
178
+
It is expected. `radian` runs on python and the python runtime used by radian is forced in
193
179
reticulate. `reticulate::py_config()` gives the note:
180
+
194
181
```
195
182
NOTE: Python version was forced by the current process
196
183
```
197
184
198
185
In order to use radian with another python runtime, you will need to install `radian` on
199
186
that python environment.
200
187
201
-
202
-
#### How to switch to a different R or specify the version of R.
188
+
#### How to switch to a different R or specify the version of R
203
189
204
190
There are serveral options.
205
191
206
192
- The easiest option is to pass the path to the R binary with `--r-binary`, i.e., `radian --r-binary=/path/to/R`
207
193
- Also, one could expose the path to the R binary in the `PATH` variable
208
194
- The environment variable `R_BINARY` could also be used to specify the path to R.
209
195
- The environment variable `R_HOME` could also be used to specify R home directory. Note that it is should be set as the result of `R.home()`, not the directory where `R` is located. For example, in Unix
196
+
210
197
```sh
211
-
$ env R_HOME=/usr/local/lib/R radian
198
+
env R_HOME=/usr/local/lib/R radian
212
199
```
213
200
214
201
#### Cannot find shared library
215
202
216
203
Please also make sure that R was installed with the R shared library `libR.so` or `libR.dylib` or `libR.dll`. On Linux, the configure flag `./configure --enable-R-shlib` may be needed to install R from the source. Do not forget to `make clean` to force the recompilation of the files with the correct compiler options.
217
204
218
-
219
205
#### Outdated setuptools
220
206
221
207
If you encounter
@@ -229,30 +215,29 @@ pip install -U setuptools
229
215
230
216
```
231
217
232
-
233
218
#### How to use local history file
234
219
235
220
_radian_ maintains its own history file `.radian_history` and doesn't use the `.Rhistory` file. A local `.radian_history` is used if it is found in the launch directory. Otherwise, the global history file `~/.radian_history` would be used. To override the default behavior, you could launch _radian_ with the options: `radian --local-history`, `radian --global-history` or `radian --no-history`.
236
221
237
-
238
222
#### Does it slow down my R program?
239
223
240
-
_radian_ only provides a frontend to the R program, the actual running eventloop is the same as that of the traditional R console. There is no performance sacrifice (or gain) while using this modern command line interface.
224
+
_radian_ only provides a frontend to the R program, the actual running eventloop is the same as that of the traditional R console. There is no performance sacrifice (or gain) while using this modern command line interface.
241
225
242
226
However, it was reported that radian may be slower when using parallel computation, specifially when using forking. User should take extra care in those cases.
243
227
244
228
#### Nvim-R support
245
229
246
230
Put
231
+
247
232
```vim
248
233
let R_app = "radian"
249
234
let R_cmd = "R"
250
235
let R_hl_term = 0
251
236
let R_args = [] " if you had set any
252
237
let R_bracketed_paste = 1
253
238
```
254
-
in your vim config.
255
239
240
+
in your vim config.
256
241
257
242
#### `reticulate` Auto Completions
258
243
@@ -263,11 +248,11 @@ pip install jedi
263
248
```
264
249
265
250
Alternatively, if you use conda,
251
+
266
252
```sh
267
253
conda install -c conda-forge jedi
268
254
```
269
255
270
-
271
256
#### Prompt not shown inside a docker container
272
257
273
258
It maybe caused by the invalid terminal size, try running `stty size` in your terminal
0 commit comments