Bug in R-pluging

Answered

I have 2 concerns,

1. Sometimes when I try to plot I get the following error. How can I solve it?

Evaluation error: unable to start png() device.

2. Ctrl + Enter doesn't run the current line of R code if it has a commend at the end. For example, 

rnorm(100) # test

rnorm(100) 

Ctrl + Enter works for the first line of code, but not for the 2nd line.

9 comments
Comment actions Permalink

Hi Quazi, which R plugin version do you use? It was completely rewritten recently, the new version is available starting with 2019.3 EAP.

0
Comment actions Permalink

I am R plugin version 193.5233.257

I've been able to narrow down the bug,

library("survival") # test

If I place my cursor anywhere on

library("survival"

Ctrl+Enter executes the line. But if it's at the last parenthesis or anywhere afterwards, ctrl+enter doesn't work.

0
Comment actions Permalink

Thanks, reproduced as well. I created a ticket in the RPlugin issue tracker https://youtrack.jetbrains.com/issue/R-400 Please feel free to follow/comment it.

1
Comment actions Permalink

The bug is solved. Now there is a weird behavior. If I press ctrl+enter then it executes the R code following the comment and white space. I do not think this is intended.

Here in an example,

 

# comment

<white line>

<white line>

x < rand(100)

 

If I press ctrl+enter when the cursor is anywhere on the comment line, the `x <- rand(100)' line is executed. Probably the expected behavior is to echo the comment in R console. It is the default behavior with RGui that comes with R.

Also if there is no R code following the comment then nothing happens. The cursor does move when I press ctrl+enter. Be the cursor is at the beginning, middle or end of the comment. This is very inorganic behavior. The cursor should at-least move to the next line showing there is nothing to do.

 

 

0
Comment actions Permalink

@ Quazi Irfan

I would argue this is expected behavior. I'm testing the latest build, and following your example - when you press ctrl+enter on the comment line, PyCharm finds the next line with the actual statement (skipping comments and blank lines), and executes it. The same behavior is seen it RStudio.

0
Comment actions Permalink

You are half right. For the other half nothing happens I when you press ctrl+enter on a comment line that doesn't follow some R code. But RStudio echos the comment line.

0
Comment actions Permalink

Can you please provide example when echoing the comment from the editor to the console can be useful? RStudio also handles it in a weird way, echoing only comments from lines above the caret unless they are separated by blank lines.

0
Comment actions Permalink

Consistency among editors.

Sometimes I walk through an entire program just by pressing ctrl+enter. Both R Editor(comes with R Gui) and RStudio has this behavior.

0

Please sign in to leave a comment.