S4 クラス定義で認識されている古いパッケージからクラスを取得するのに問題があります。エラーが発生し続けます
Error in makePrototypeFromClassDef(properties, ClassDef, immediate, where) :
in making the prototype for class "Tsvmm" elements of the prototype failed to
match the corresponding slot class: dates (class "dates" )
In addition: Warning message:
undefined slot classes in definition of "Tsvmm": dates(class "dates")
再現可能な例:
require(chron)
setClass(
Class="Tsvmm",
representation=representation(
data = "data.frame",
dates = "dates"
),
prototype=prototype(
data = data.frame(),
dates = chron(0)
)
)
を試してみるとclass(chron(0))
、答えは"dates" "times"
です。を使用するis.numeric(chron(0))
と、答えはTRUE
です。それでも、スロット日付のクラスを に設定すると"numeric"
、警告メッセージなしで同じエラーが発生します。
明らかな何かを見落としているような気がしますが、ドキュメントにはまだ見つかりませんでした。誰かポインタはありますか?
chron
PS:パッケージが少なくとも独特であることは知っていますが、これを使用する十分な理由があります。さらに、この問題は他のパッケージでも発生する可能性があります。一般的な質問の例としてこれを参照してください。ですから、Date または POSIXt クラスを使用するように言わないでください。それは私が今使っているハックです。