From simon.urbanek at r-project.org  Wed Sep  7 21:32:30 2011
From: simon.urbanek at r-project.org (Simon Urbanek)
Date: Wed, 7 Sep 2011 15:32:30 -0400
Subject: [Rd] Refresh every minute
In-Reply-To: <1315423649399-3797011.post@n4.nabble.com>
References: <1315423649399-3797011.post@n4.nabble.com>
Message-ID: <B4998159-0189-49AE-9C2D-32A43338EE81@r-project.org>


On Sep 7, 2011, at 3:27 PM, Schatzi wrote:

> I would like some code to rerun every minute, automatically (it calls time
> and I want this to update). 
> Here is the code (it is really the plot that I am interested in): 
> 
> 
> hourc<-as.numeric(substr(date(),12,13)) 
> minc<-as.numeric(substr(date(),15,16)) 
> ftime<-c(hourc,minc) 
> barplot(ftime, axes = FALSE, main="Time") 
> 
> 
> Is there any way to get this to automatically update every minute or do I
> have to rerun it manually each time I want to see the updated plot? 
> 

while (TRUE) {
 hourc<-as.numeric(substr(date(),12,13)) 
 minc<-as.numeric(substr(date(),15,16)) 
 ftime<-c(hourc,minc) 
 barplot(ftime, axes = FALSE, main="Time") 
 Sys.sleep(60)
}


> I am using microsoft (vista). 
> 
> -----
> In theory, practice and theory are the same. In practice, they are not - Albert Einstein
> --
> View this message in context: http://r.789695.n4.nabble.com/Refresh-every-minute-tp3797011p3797011.html
> Sent from the R devel mailing list archive at Nabble.com.
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
> 
> 



[Rd] Refresh every minute
Simon Urbanek