Disable auto-update from R (Windows)

January 21, 2011
By

(This article was first published on [the] joint posterior distribution, and kindly contributed to R-bloggers)

There are two major threats to complex MCMC estimations:
  • Wrong energy settings (hibernate after 2 hours of inactivity)
  • Automatic Updates (install updates at 3 a.m.)

I thought about the latter threat. At times, you may hand some R code to other co-workers, especially when you need to estimate lots of different models in a short period of time. If they have auto-updates enabled, your results are quickly in jeopardy. While automatically saving the workspace [if(rep==10000) save.image("save.RData")] is definitely a very good idea, deactivating automatic updates on windows is still important for long-term calculations.
Therefore I thought about ways to deactivate automatic updates from within R. A major obstacle is UAC (user account control) which turns your administrator account into something ... with less right. Windows frequently asks for privilege elevation. Sadly, elevation does not work without further administrative tools, which you will not find on every PC around. Therefore I decided to use the "runas" command, which will ask the user for her password once.
Although this is not a perfect solution yet, it is also a very nice example on some interesting functions: paste, sub, system.

[EDIT]
"runas" apparently does not work with "net stop" command, therefore a .bat file needs to be created which can be started using runas. The .bat is created from within R.

[EDIT2]
Random John reminded my that an option to turn auto update back on would be nice. Well, I added that.


To leave a comment for the author, please follow the link and comment on his blog: [the] joint posterior distribution.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.