gWidgets - ginput() function error

£可爱£侵袭症+ 提交于 2019-12-13 03:49:39

问题


I'm having a problem with launching the ginput pop-up from gWidgets.

This is the error:

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.

Code snippet as follows:

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

Supplementary info:

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.

Right now i suspect it's RStudio but i don't know how to fix it.

Any help is greatly appreciated.

Alex

ANSWER:

The error threw me a bit and looks more complicated than it really is.

I fixed by simply installing "gWidgetstcltk". I assumed that because I load tcltk and gWidgets separately that it would be enough. Thanks Alex


回答1:


Please see original post for the fix. Best,

Alex



来源:https://stackoverflow.com/questions/45844658/gwidgets-ginput-function-error

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!