[R] Usage questions
Jim Lemon
bitwrit at ozemail.com.au
Fri Aug 11 13:45:36 CEST 2000
Paul Johnson wrote:
>
> Can I ask a couple of usage questions? (RedHat Linux 6.1, R-1.1)
>
> 1. This may just indicate I'm a dinosaur who can't leave SAS behind.
I
> want to write programs and run them with source() to see what they do,
> then I would like to use the "up arrow" to go back through the
commands
> that were in the file, fiddle them, see what they do, and so forth.
Is
> there no way? SAS has a functionality of a "program editor" screen
> where you can fiddle a file, run it, then save it when it is the way
> you want. But in R I don't get any command history with source(), so I
> can't experiment with commands.
I often write the commands for analysis in an editor (I happen to use
NEdit) while running R and "source" the file in the R xterm. I can
correct any errors or refine analyses or plots on the fly and I have a
record of the final commands. I often have to go back to this file if
the analyses have to be rerun, or if new data is added, etc., so I
typically comment as I go. You can use either the
# this is a comment
style for reference in the source file only, or the
cat("This is a comment\n")
style that will print out the comment in the output. This is especially
useful when you are "sink"ing the output to another text file.
Jim
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list