在R中禁用/抑制tcltk弹出窗口以进行CRAN镜像选择 [英] Disable/suppress tcltk popup for CRAN mirror selection in R

查看:133
本文介绍了在R中禁用/抑制tcltk弹出窗口以进行CRAN镜像选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题类似于先前发布的问题,但在这里从未真正回答过:

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

在R中禁用GUI和图形设备

我不喜欢CRAN镜像选择的R tcltk弹出窗口.当在两个包中搜索有关功能的帮助时,他们还会弹出以选择一个包.

I do not like the R tcltk popups for CRAN mirror selection. They also pop up to choose a package when searching for help on a function in two packages.

是否可以在不完全禁用X11的情况下禁用这些窗口?我仍然希望plot()命令能够正常工作,但是要禁用一些小的选择菜单,而这些选择菜单需要花费很长时间才能通过远程连接加载.

Is there any way to disable these windows without disabling X11 completely? I still want plot() commands to work as normal, but disable the little select menus that take forever to load over a remote connection.

例如,如果您使用ssh,但不使用-X,则镜像选择只是R中的文本,请键入数字.它很快.这就是我想要的,但是为图b维护X11.

For example, if you use ssh, but don't use -X, then the mirror select is just text within R, you type a number. It's fast. This is what I want, but maintaining X11 for plots b.

有人知道如何维护图形窗口,但禁用选择" tcltk窗口吗?

Anyone know how to maintain graphics windows but disable the "choice" tcltk windows?

推荐答案

Dirk提供了完全避免菜单的方法,但是我想回答您提出的问题

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

options(menu.graphics=FALSE)

我通过找到从help返回的对象类(它是help_files_with_topic),扫描utils:::print.help_files_with_topic并找到行

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"))

这篇关于在R中禁用/抑制tcltk弹出窗口以进行CRAN镜像选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆