質問

あなたがパッケージにバグを見つけた場合は、

は、それは例えば、fixInNamespaceで問題にパッチを適用することは通常可能ですfixInNamespace("mean.default", "base")ます。

S4方法については、私はかかわらず、それを行うかどうかはわかりません。私が探しています方法はgWidgetstcltkパッケージです。あなたがソースコードを見ることができます。

getMethod(".svalue", c("gTabletcltk", "guiWidgetsToolkittcltk"))

私はfixInNamespaceと方法を見つけることができません。

fixInNamespace(".svalue", "gWidgetstcltk")

Error in get(subx, envir = ns, inherits = FALSE) : 
  object '.svalue' not found

私はsetMethodはトリックを行うかもしれないと思ったが、

setMethod(".svalue", c("gTabletcltk", "guiWidgetsToolkittcltk"),
  definition = function (obj, toolkit, index = NULL, drop = NULL, ...) 
  {
      widget = getWidget(obj)
      sel <- unlist(strsplit(tclvalue(tcl(widget, "selection")), 
          " "))
      if (length(sel) == 0) {
          return(NA)
      }
      theChildren <- .allChildren(widget)
      indices <- sapply(sel, function(i) match(i, theChildren))
      inds <- which(visible(obj))[indices]
      if (!is.null(index) && index == TRUE) {
          return(inds)
      }
      if (missing(drop) || is.null(drop)) 
          drop = TRUE
      chosencol <- tag(obj, "chosencol")
      if (drop) 
          return(obj[inds, chosencol, drop = drop])
      else return(obj[inds, ])
  },
  where = "package:gWidgetstcltk"  
)

Error in setMethod(".svalue", c("gTabletcltk", "guiWidgetsToolkittcltk"),  : 
  the environment "gWidgetstcltk" is locked; cannot assign methods for function ".svalue"

任意のアイデア?

役に立ちましたか?

解決

どのように、ソースを取得して変更を適用し、再建の古い学校の方法について?

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top