Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VScode inserts a bracket ")" when pressing Ctrl+Enter in the editor

Sometimes, when pressing Ctrl+Enter in VScode (Windows) to run a line of R code in the editor, it sends the code in the R terminal window and inserts a ")" at the end of the code and doesn't execute it. I installed VScode as per the online instructions. Most of the time I don't get that issue but sometimes I do (I beleive mostly when running a function with curly brackets {} ).

I inserted a screenshot for reference. VScode inserting a ")" when pressing Ctrl+Enter in Rscript

like image 453
CyG Avatar asked Aug 23 '26 17:08

CyG


2 Answers

I looked through the github issues for vscode-R. This is a Windows specific issue. There's a thread on this and the solution is not obvious/does not exist yet: https://github.com/REditorSupport/vscode-R/issues/820

Leaving the post here in case it might help people in the future

like image 56
CyG Avatar answered Aug 25 '26 07:08

CyG


I use WINDOWS. This solution seems to work:

Create a file called .radian_profile in the working directory. You can check your working directory by running getwd() in radian when it starts up.

In the .radian_profile file you created, paste this line:

options(radian.auto_match = FALSE)

like image 38
Juan Avatar answered Aug 25 '26 09:08

Juan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!