Reputation: 33
I have just switched from windows 7 to windows 10 on my pc.
When I was still using windows 7, using the combination CTRL+R or CTRL+ENTER would run the line of code that I was in. Moreover, if the code continued on one or more lines below or started above my current line, it would run the entire section without me having to select it.
After switching to windows 10, the same combinations will only run the line of code that I am currently in, or the piece of code that is selected by me. To give an example:
#Tryout
for(i in 1:3){
print(i)
}
This code would normally run at once without having to select it, even when I would start in the first line (#Tryout). Now, if I don't select, I will need to use CTRL+R or CTRL+ENTER three times to go through this code and I have to start in the correct line. Starting in the line #Tryout will not run any part of the code but will only result in the line #Tryout being shown in the console.
I'm not good with computers (in your answers please pretend to be adressing a five-year-old) so I had one of my colleagues look at it who's our expert on R. Here are the findings:
The problem is not preventing me from using R, but it is tedious and I hope someone can help me to solve it. Thanks so much for reading!
Upvotes: 3
Views: 9890
Reputation: 33
@M Waz & @Just Burfi: I know I can select the code and then run it, that works fine. But I don't want to have to manually select the code all the time.
@Clemsang: your answer puzzled me for a moment because I didn't have the CTRL + Enter Executes
that you were referring to. I went back to my colleague who had the bright idea to check the version of RStudio that I was using.
As it turns out, I was using an old version (0.99.903). Now that I've installed a newer version (1.1.463), running the code works as before! I also have the CTRL + Enter Executes
now.
Upvotes: 0
Reputation: 5481
Click on header Tools
, then Global Options...
, then Code
, then Ctrl + Enter Executes
and choose Multi-line R statement
Upvotes: 2