Static method to load an Object from a file or a connection, which previously have been saved using save()
of
class Object.
## Static method (use this):
## Object$load(file, path=NULL, ...)## Don't use the below:
# S3 method for Object
load(static, file, path=NULL, ...)
Returns a reference to the loaded Object.
Filename or connection
from where to read the Object.
The path where the file exists.
Not used.
Typically this static method is called as <Object>$load(...)
where <Object>
is any Object class. When an Object has been
loaded, it is verified that it inherits from <Object>
. If it
does not, an exception is thrown. Thus, Object$load(...)
will
load any Object, but MyClass$load(...)
will only load an Object
that inherits from MyClass. If loaded object is not of correct class,
an exception is thrown.
Due to a bug, likely in R itself, one can not specify the file
argument by its name, i.e. Object$load(file="foo.RData")
will
not work, but Object$load("foo.RData")
work just fine.
Henrik Bengtsson
Please note that no constructors are called when an Object is loaded and neither is any static class code called.