问题
Is there any IDE -from the ones supporting R-, that gives access to the command history (at least to the current session's commands)? Or is there a way to get a (character or expression) vector with those commands in R?
For those of you that have been using MATLAB, I mean something like the Command History window there..
Thank you
回答1:
history(Inf)
opens a window similar to that in MATLAB.
回答2:
savehistory('file')
myhistory <- scan('file','character')
Might do the trick.
回答3:
I would highly recommend to use Emacs with ESS (Emacs speaks Statistic)
回答4:
Eclipse with Stat-ET plugin will get you command history window and object browser.
回答5:
The OS X GUI for R has a very nice command history mechanism built in. It works well with multi-line commands (e.g. long function definitions), and you can browse through the history in a pane on the side of the window.
回答6:
The command history()
will recall the last 25 used commands, whereas history(max.show=Inf)
will get back all previous ones. If you are using RStudio on top of your R distro, CTRL + UP
will give you the list of all previous commands.
来源:https://stackoverflow.com/questions/2749390/command-history-in-r