| Version Management {distr} | R Documentation |
Methods for Version Management in Package ‘distr’
Description
Version-Management-methods
Usage
isOldVersion(object)
conv2NewVersion(object)
## S4 method for signature 'ANY'
isOldVersion(object)
## S4 method for signature 'ANY'
conv2NewVersion(object)
## S4 method for signature 'LatticeDistribution'
conv2NewVersion(object)
Arguments
object |
object of class |
Details
From version 1.9 of this package on, class "AbscontDistribution" has an extra slot
gaps. As the addition of new slots will probably happen again in the future development
of our packages, we provide the following two help functions
isOldVersion and conv2NewVersion to check whether the object was generated by an
older version of this package and to convert such an object to the new format, respectively.
Also, the intermediate class "LatticeDistribution" is introduced at version 1.9
so that all subclasses of "DiscreteDistribution" like "Binom", "Nbinom" etc,
now have an extra slot lattice. conv2NewVersion takes this up and provides
a particular method for signature "LatticeDistribution" which fills slot
lattice accordingly.
- isOldVersion
signature(object = "ANY"): throws an error ifisClass(class(object))isFALSE, i.e.; if the class ofobjectis no formal (S4) class. Else it checks whether all slots of the actual class definition may be accessed and if so returnsFALSEand elseTRUEand issues a warning.- conv2NewVersion
signature(object = "ANY"): Generates a valid copy ofobject(according to the actual class definition), using the slots ofobjectwhere possible and for the slots which are not yet present inobject(because it was generated by an older version of the class definition), it generates a prototype object of the class ofobjectwithnew(class(object))and uses the slot values of this prototype to fill the missing slots.- conv2NewVersion
signature(object = "LatticeDistribution"): Generates a valid copy ofobject(according to the actual class definition, i.e.; with a correspondinglattice-slot), by generating a new instance of this object bynew(class(object), <list-of-parameters>.