クラスitem
に関数length()
を使用して、ベクトルoptions
の長さを明らかにしようとしています。新しいクラスにlength()を使用するR
setClass(Class = "item",
representation = representation(
options = "character"
),
prototype = prototype(
options = character()
)
)
setGeneric("length")
setMethod("length", signature(x = "item"), definition = function(x) length([email protected]))
しかし、私はいつも次のエラーを取得する:
Error: could not find function "getGeneric"
Warning:
In .rk.get.structure.global(".__C__item") :
failure to get object .__C__item
私はRKWardバージョン0.5.7z + 0.5.8 + devel1でR version 2.13.2 (2011-09-30)
を使用しています。
を呼び出し –
OK、RKWardバージョン0.5.7z + 0.5.8は+ devel1に問題があるように思われます。プレーンなRシェルでは、コードは難なく実行されます。 – woobert
'methods :: setGeneric' /' methods :: setMethod'、RKWardがあまりにも巧妙だったので? –