[R] pause

ben@zoo.ufl.edu ben at zoo.ufl.edu
Mon Mar 12 17:07:01 CET 2001


  I don't know how the timing would work exactly, but you could write a
very short piece of C code (details would depend on your operating system,
man usleep for Linux) -- you'd probably have to calibrate for the average
time that the function call took, too.
  Or you could just try to calibrate a delay loop:

delayloop <- function(x=1000) {
  for (i in 1:x) {}
}

dtime <-
sapply(seq(3,6,by=0.2),
  function(z)system.time(delayloop(10^z))[3])

plot(seq(3,6,by=0.2),dtime,type="b",log="y")

of course, this would vary from system to system depending on speed ...

On Mon, 12 Mar 2001, Roger Koenker wrote:

> I've been playing with a quincunx animation in R 1.2.2 and would like
> to have finer control over the speed of the animation.  I know that I
> can use system("sleep 1") on unix systems at least, but it would be
> nice to have something like pause(.01).  Any suggestions?
>
>
> url:	http://www.econ.uiuc.edu		Roger Koenker
> email	roger at ysidro.econ.uiuc.edu		Department of Economics
> vox: 	217-333-4558				University of Illinois
> fax:   	217-244-6678				Champaign, IL 61820
>
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> 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
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>

-- 
318 Carr Hall                                bolker at zoo.ufl.edu
Zoology Department, University of Florida    http://www.zoo.ufl.edu/bolker
Box 118525                                   (ph)  352-392-5697
Gainesville, FL 32611-8525                   (fax) 352-392-3704

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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