Hi,

On Thursday 26 November 2009, Prasenjit Kapat wrote:
> This has been a very long standing itch of mine - to get rid of the
> ugly (and very minimally informative) Tcl/Tk box to choose the CRAN
> mirrors (one that pops up during install.packages or update.packages
> or ...). Basically, to set options(repos=c(CRAN=....)) with an actual
> url instead of '@CRAN@'.
> 
> I've added a combobox (see attached image). But there is a bug:
> 
> Every time rkward is started, the repos url is set to "" (empty). Once
> you go to Settings > R-packages  and set a 'CRAN download mirror' and
> click apply, only then the repos url is set properly.

I have not done any testing, yet. I believe the bug is that you save the index 
position of the list. When loading the settings, this is not resolved to the 
corresponding url, so you get an empty string, instead. I think the best 
solution is to simply store the url in the config. This is also less error-
prone if / when the list changes one day.

Another thing: Are you aware of getCRANmirrors()? I guess it does most of what 
you do in CRAN_mirror_list.R in a way that is less likely to break in the 
future.

On a more general note: I don't like the hard-coding involved, and would 
rather like to see a more generic solution. If the main issue is the Tcl/Tk 
dialog, we could (and should) get rid of that in general by overriding menu().

Steps involved in that approach:
1) Change menu() so that if "graphics" is TRUE, something like
      .rk.do.call ("menu", c (choices, title))
will be called. The default behavior otherwise. NOTE: Need to use 
assignInNamespace() to override the menu function in the utils namespace.
2) The call would be implemented in RInterface::processREvalRequest() (where 
there are many examples of the basic idea).

Of course this does not store the mirror-setting permanently, so you would 
still be prompted for a mirror each session. But it would be with a "nice" 
dialog instead of the tcl/tk one. Want to give that a try?

Regards
Thomas

Attachment: signature.asc
Description: This is a digitally signed message part.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
RKWard-devel mailing list
RKWard-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rkward-devel

Reply via email to