gWidgets-ginput()函数错误 [英] gWidgets - ginput() function error
问题描述
从gWidgets启动ginput弹出窗口时遇到问题.
I'm having a problem with launching the ginput pop-up from gWidgets.
这是错误:
正在加载所需的软件包:gWidgetstcltk (函数(类,fdef,mtable)中的错误: 找不到签名"guiWidgetsToolkittcltk""的函数".ginput"的继承方法 另外:警告消息: 在库中(包,lib.loc = lib.loc,character.only = TRUE,logical.return = TRUE,: 没有名为"gWidgetstcltk"的软件包
Loading required package: gWidgetstcltk Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘.ginput’ for signature ‘"guiWidgetsToolkittcltk"’ In addition: Warning message: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, : there is no package called ‘gWidgetstcltk’
我使用弹出窗口键入一个数字,然后将其分配给变量.
I use the popup to type a number that I then assign to a variable.
代码段如下:
options(guiToolkit = "tcltk") # Tool kit dependency for gwidgets.
library(gWidgets) # Package required to launch ginput gui.
width.var <- as.numeric(ginput("Enter value for - Width ",
title = "PNG dimensions",
icon = "info"))
补充信息:
我将我的R版本从3.2.5更新到了3.4.1,并安装了最新的RStudio版本.我已经在R3.4.1上运行了此代码部分,但是在另一台计算机上没有任何问题.
I updated my R version from 3.2.5 to 3.4.1 as well as installing the latest RStudio version. I've run this code section before on R3.4.1 but on a different computer without any issues.
现在我怀疑它是RStudio,但我不知道如何解决它.
Right now i suspect it's RStudio but i don't know how to fix it.
非常感谢您的帮助.
亚历克斯
答案:
该错误使我有些困惑,看起来比实际情况还要复杂.
The error threw me a bit and looks more complicated than it really is.
我通过简单地安装"gWidgetstcltk
"来修复.我以为是因为我分别加载了tcltk和gWidgets就足够了.谢谢亚历克斯
I fixed by simply installing "gWidgetstcltk
". I assumed that because I load tcltk and gWidgets separately that it would be enough. Thanks Alex
推荐答案
请参阅原始帖子以获取此修复程序.最好,
Please see original post for the fix. Best,
亚历克斯
这篇关于gWidgets-ginput()函数错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!