I'd like to run an R code automatically on Windows 7, say once every 2 hours. Could anyone tell me how to manage it? Thanks in advance! Best regards, Ken [[alternative HTML version deleted]]
That is what the task scheduler is for. Just create a ".bat" file that invokes R and schedule it every two hours. On Win XP it is Control Panel/Scheduled Tasks. On Mon, Dec 19, 2011 at 11:10 AM, Kenneth Zhang <kennethrrr at gmail.com> wrote:> I'd like to run an R code automatically on Windows 7, say once every 2 > hours. Could anyone tell me how to manage it? > > Thanks in advance! > > Best regards, > Ken > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.-- Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it.
I don't know if this code match what you want. You should use tcltk library.
code:
library(tcltk)
z <- function () { cat("Hello you!\n"); .id <<-
tcl("after", 1000, z)}
z()
If you want to cancel you can use:
.id <<- tcl("after", 1000, z)
tcl("after", "info", .id) # To get info about this
scheduled task
tcl("after", "cancel", .id) # To cancel the currently
scheduled task
Regard,
Agus MS
On Mon, Dec 19, 2011 at 11:10 PM, Kenneth Zhang
<kennethrrr@gmail.com>wrote:
> I'd like to run an R code automatically on Windows 7, say once every 2
> hours. Could anyone tell me how to manage it?
>
> Thanks in advance!
>
> Best regards,
> Ken
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
[[alternative HTML version deleted]]