[R] evaluating keystroke
mark at myatt.demon.co.uk
Wed Jul 25 12:20:40 CEST 2001
David White <dwhite at ling.ohio-state.edu> writes:
>On the question of evaluating keystrokes:
>I often plot subsets of data to get a sense of what I'm looking for. I
>generally run a for loop with the specification par(ask=TRUE) after each
>plot command, so that I can take time to look over the data before going
>on to the next plot by pressing RETURN.B
>Would it be possible to use readline() in such a command sequence to write
>a comment about each plot before going on to the next? This would
>certainly help me take quicker and better notes when examining data, and
>might even allow me to use R in a perception/classification experiment.
comments <- vector(mode = "character")
for(i in 1:(dim(volcano) - 1))
plot(volcano[ ,i], volcano[ ,i+1], main = paste("Plot ", i))
comments[i] <- readline("Comments : ")
Should do the trick.
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