I can't find something to the effect of an undo command in R (neither on An Introduction to R nor in R in a Nutshell). I am particularly interested in undoing/deleting when dealing with interactive graphs.
What approaches do you suggest?
Unless you still have the file open in the editor, no, there's no way to undo the change. But since you mention RStudio in the title, I'm assuming that you're editing the file from within the RStudio text editor? In that case, no problem — just hit “undo”.
Simply hit Ctrl+L on the keyboard and you will see that everything written in the console will be erased and the console will be cleared.
To undo an action press Ctrl+Z. If you prefer your mouse, click Undo on the Quick Access Toolbar. You can press Undo (or CTRL+Z) repeatedly if you want to undo multiple steps.
You should consider a different approach which leads to reproducible work:
All this works tremendously well in ESS which is why many experienced R users like this environment. But editors are a subjective and personal choice; other people like Eclipse with StatET better. There are other solutions for Mac OS X and Windows too, and all this has been discussed countless times before here on SO and on other places like the R lists.
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