checkProtection {goCluster} | R Documentation |
This function can be called by a method that will overwrite object data.
checkProtection
will retrieve the list in the reset
-slot
of the given object. The names of elements in this list will be
considered as slot names and each list element will be compared
against the value in the corresponding slot. If the length of any such
pairs differs an error message will be issued.
checkProtection(object, method)
object |
The object to check |
method |
A string that names the method trying to overwrite data. It will be included in the error message. |
An error message in case the calling method would overwrite already calculated values.
Gunnar Wrobel, http://www.gunnarwrobel.de.
data(benomylsetupsmall) a <- new("goCluster") ## No error since the object has not been calculated yet checkProtection(a@algo,"test") execute(a) <- benomylsetupsmall ## This results in an error since the object contains calculated data error <- try(checkProtection(a@algo,"test"), silent = TRUE) error ## No error since no visualization method has been chosen checkProtection(a@visu,"test")