Hi there, I am using the windows version R1.9.0. I used to be a Splus user. When I used Splus to try some computation, I like to put all my codes in a script file and check them line by line. This way I can keep track of all my thinking and it's very easy to make correction at some earlier steps. Now I can not find this script-file style in R. The software itself doesn't seem to have a script file editor. I can only use other editor software (e.g., notepad) to write a ".R" file, and then "source" it in R. It's not convenient to debug in this way. Any one can help me? Thank you very much! Jia
On Sun, 4 Jul 2004, Jiacheng Yuan wrote:> I am using the windows version R1.9.0. > I used to be a Splus user. When I used Splus to try some computation, I like > to put all my codes in a script file and check them line by line. This way I > can keep track of all my thinking and it's very easy to make correction at > some earlier steps. > > Now I can not find this script-file style in R. The software itself doesn't > seem to have a script file editor. I can only use other editor software > (e.g., notepad) to write a ".R" file, and then "source" it in R. It's not > convenient to debug in this way.You are not expected to. I usually copy and paste from an external editor, and rarely use source. Both S(-PLUS) and R have long had modes for editors allowing much more than the S-PLUS script windows: indeed they were copied from such modes. Take a look at http://cran.r-project.org/other-software.html In ESS (and I believe R-WinEdt) you can submit code by highlighting and using an editor command.> Any one can help me?You can already display a file in RGui using the File menu, and highlight lines there and submit them. If you want to change them, use up-arrow and edit them in the commands buffer. You could also try the R-devel prerelease (on CRAN), as it can edit such a displayed file. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
You can do this: f <- function(x)x fix(f) # you are now put into an editor and can change the function # when you save the file you will be taken back to R with the new version of f Alternately, you can ease the use of the source style of operating by hitting up-arrow a few times in the R console to get your last source command so its just a matter of upwarrowing and pressing Enter. One other thing to note is that there are a number of editors that support R syntax highlighting including ESS and gvim and that can ease development too. Jiacheng Yuan <jiachengyuan <at> hotmail.com> writes: : : Hi there, : : I am using the windows version R1.9.0. : I used to be a Splus user. When I used Splus to try some computation, I like : to put all my codes in a script file and check them line by line. This way I : can keep track of all my thinking and it's very easy to make correction at : some earlier steps. : : Now I can not find this script-file style in R. The software itself doesn't : seem to have a script file editor. I can only use other editor software : (e.g., notepad) to write a ".R" file, and then "source" it in R. It's not : convenient to debug in this way. : : Any one can help me? : Thank you very much! : : Jia : : ______________________________________________ : R-help <at> stat.math.ethz.ch mailing list : https://www.stat.math.ethz.ch/mailman/listinfo/r-help : PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html : :