radian
radian copied to clipboard
How to know if R is "thinking"
Thanks so much for the great R console, I'm really enjoying using it so far.
I have one issue I can't seem to solve, though. There is no way to tell if R is running something and simply taking a long time to run the computation and respond, or if I have missed a parenthesis somewhere and R is waiting for more input for me.
For example, if I have a complex ggplot (or dplyr pipe-chain), and I miss an paren:
ggplot(data) +
geom_line(aes(x=x, y=y, color=color)) +
scale_fill_manual(values=c("#43434", "#242424", "#565656") + #Notice this line is missing a paren
theme_bw()
If I put this in a regular R console hit return several times, I will see +
symbols indicating R is expecting more input:
> ggplot(data) +
+ geom_line(aes(x=x, y=y, color=color)) +
+ scale_fill_manual(values=c("#43434", "#242424", "#565656") + #Notice this line is missing a paren
+ theme_bw()
+
+
+
+
However, if I run the same code in radian, I just get whitespace, the same as I would if R was "thinking" and taking some time to respond.
[ins] r$> ggplot(data) +
geom_line(aes(x=x, y=y, color=color)) +
scale_fill_manual(values=c("#43434", "#242424", "#565656") + #Notice this line is missing a paren
theme_bw()
So how can I tell when R is "thinking" vs I have failed to finish my input? I looked through the options but nothing stuck out.
I noticed that when R is "thinking" the cursor goes all the way to the left, whereas when the command is not finished it stays aligned with the code. Not the easiest to spot but it can help when in doubt.
For instance try Sys.sleep(10)
vs Sys.sleep(10
(with missing right bracket).
Thanks, but I am usually copying text into R from an editor, so in my .radian_profile
I have:
options(radian.indent_lines = FALSE)
options(radian.auto_indentation = FALSE)
Turning off either one of those seems to keep the cursor all the way to the left.