SnnsR-class objects.SnnsRObject$initializeNet for such an
implementation. Error handling is also done within the method caller. If
the result of a function is a list with a member
err, then SnnsCLib__error is called to use
the SNNS kernel function to get the corresponding error
message code and an R warning is thrown containing this
message.
Furthermore, a serialization mechanism is implemented which all models present in the package use to be able to be saved and loaded by R's normal save/load mechanism (as RData files).
The completely trained object can be serialized with
s <- snnsObject$serializeNet("RSNNS_untitled")
snnsObject@variables$serialization <-
s$serialization
For the models implemented, this is done in
SnnsRObject$train. If the S4 object is then
saved and loaded, the calling mechanism will notice on
the next use of a function that the pointer to the C++
SnnsCLib object is nil, and if a serialization is
present, the object is restored from this serialization
before the method is called.