Disable/suppress tcltk popup for CRAN mirror selection in R

后端 未结 3 1291
春和景丽
春和景丽 2020-12-23 23:21

My question is similar to a question previously posted but never really answered here:

Disable GUI, graphics devices in R

I do not like the R tcltk popups fo

相关标签:
3条回答
  • 2020-12-23 23:39

    Just set a mirror in the startup files. I have this in my ~/.Rprofile and I never see that prompt:

    ## Default repo
    local({r <- getOption("repos");
           r["CRAN"] <- "http://cran.us.r-project.org"; 
           options(repos=r)})
    

    See help(Startup) for more things you can customize here, and also see this excellent SO question on customizing ~/.Rprofile.

    Edit: As for your additional question just added in the comments, that is different. In this case you could specify the mapply explicitly by using the namespace and :: operator. For example, base::mapply(foo, bar) would unambiguously pick one from the standard library, and similarly help(mapply, package="base") asks for the help for a given function from a given package.

    0 讨论(0)
  • 2020-12-23 23:41

    Dirk provides ways to avoid the menus altogether, but to answer your question as posed, I think you want

    options(menu.graphics=FALSE)
    

    I tracked this option down by finding the class of objects returned from help (it's help_files_with_topic), scanning utils:::print.help_files_with_topic and finding the line

    menu(txt, title = gettext("Choose one"), graphics = getOption("menu.graphics"))
    
    0 讨论(0)
  • 2020-12-23 23:44

    Also have a look at the interactivity package in CRAN if you wish to completley disable interactive funky stuff.

    0 讨论(0)
提交回复
热议问题