Hi,

I've written the following function to display small windows of a time
series (and a processed version of it) with mouse clicks used to move the
window forward.

 

ViewRawAndProcessed <- function(raw, processed, width=1000)

{

      len <- length(raw)

      n <- round(len/width)

      for (i in 1:n)

      {

            plot(raw[((i-1)*width):(i*width)], type="s")

            lines(processed[((i-1)*width):(i*width)], type="s", col="red")

            s <- sprintf("%d - %d", (i-1)*width,(i*width))

            mtext(s)

            par(ask=TRUE)

      }

}

 

What I'd like to do is modify the function so that it stays within a loop
and accepts right and left cursor keys (or h and l) to shift the current
window backwards and forwards (with the q key causing a break from the
loop).

 

Is this possible with the par(ask=TRUE) command?

 

Thanks,

Chris Paulse


	[[alternative HTML version deleted]]


