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) +
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.
To quit R you can either use the RStudio > Quit pull-down menu command or execute ⌘ + Q (OS X) or ctrl + Q (PC).
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.
Press 'Esc' key will bring you back to the prompt (<).
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With