.onLoad and gWidgets R - error in package build

╄→尐↘猪︶ㄣ 提交于 2019-12-24 17:57:09

问题


I've just finished making another R tool for a colleague and have done a simple gWidgets GUI to go with it. However I'm having trouble getting it to come up on package load:

The error when building the package comes straight away in the .onLoad function, as soon as gwindow is called, on my system, even the following tidbit of code causes the error when I build the package binary - let alone my full gui:

.onLoad <- function(...){

  MainWindow <- gwindow("My GUI Window!", visible=TRUE)


}


call: function (classes, fdef, mtable) 
      error: unable to find an inherited method for function '.gwindow' for signature '"NULL"'
    Error: loading failed
    Execution halted
    ERROR: loading failed

I checked out Rcmdr's source files - tcltk objects/widgets are called in it's code in the .onLoad() function so I figures placing the code for my gui in the onload function would be the way to go. I make sure to import gWidgets and gWidgetstcltk (I'm on Windows).

来源:https://stackoverflow.com/questions/15647991/onload-and-gwidgets-r-error-in-package-build

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