Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ending "+" prompt in R

Tags:

r

r-faq

I'm fairly new to R and I made a type-o while entering some code and now instead of getting the ">" prompt I get a "+" prompt. I appear to be stuck in some kind of function that is looking for input, but I can't seem to get out of it. I figure that there must be a better way to fix this problem then closing R and rerunning my script but I haven't been able to find anything on google (likely because I don't know the right search terms).

Thanks for your help, sorry it's a trivial question

The code I entered was as follows:

> fit = lm(x~`y) + fit = lm(x~y) + fit + summary(fit) +  +  + end + ; + break + ) +  +  +  + 
    
     + 
     + quit() +  + quit + break() + abline(b0hat,b1hat) + return(null) +  
like image 817
TMin Avatar asked Sep 14 '13 15:09

TMin


People also ask

How do I end code in R?

The shortcut to interrupt a running process in R depends on the R software and the operating system you are using. However, if you are using RStudio on a Windows computer, you can usually use Esc to stop a currently executing R script. Then, we can press Esc to interrupt the loop.

How do you exit a line in R?

To quit R you can either use the RStudio > Quit pull-down menu command or execute ⌘ + Q (OS X) or ctrl + Q (PC).

What does prompt mean in R?

prompt(object) The prompt function creates a package help file for object. This function should be used to generate help files for new objects or functions being added to an R package. object – An R object, most often a function or a data frame.

How do I get the prompt back in R?

Press 'Esc' key will bring you back to the prompt (<).


1 Answers

It depends on how you’re running R.

In the terminal, the “normal” way is Control+C – the “cancel” key combination.

In the graphical R application and in RStudio, it’s Escape.

like image 192
Konrad Rudolph Avatar answered Sep 21 '22 12:09

Konrad Rudolph