reference class - Why are inheritance relationships of R5 classes not defined during R package .onLoad()? -


I am trying to initialize and store some package specific information when the package is first loaded and I am very good Information is found on the way to do this, and however, a package that wants to call during the package load, affirms the relationship of inheritance of many classes defined in the package, but this results in the different results of what I expect There arise. I can come in different ways to solve this problem, but I am trying to understand what I am doing and hopefully someone can explain it to me.

prototype = prototype (value = 42)) setClass ("myderivedclass", in = "myclass ") Package # Load Function. Download & lt; - .onLoad , extension ("myderivedclass", "myclass") ("something") during the function (lib, pkg) {if (! ("Myderivedclass", "myclass" Is not ")}}

evaluates FALSE (to trigger the warning), but of course, when the package is loaded Evaluates TRUE , which I expected to start with objects in class either during the .onLoad works fine, so it is not that class definitions are just now Not loaded until

Thanks a lot for any help I'm testing this kind of during the .onLoad or I can be misunderstood about heritage here. Session information:

  & gt; SessionInfo () R Version 3.1.0 (2014-04-10) Platform: x86_64-apple-darwin10.8.0 (64-bit)    

By this way, Code> Expanded ("myderivedclass", "myclass") During the package loading, evaluates correctly for TRUE .

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -