set_obj_method {struct} | R Documentation |
a helper function to update methods for a struct object
set_obj_method( class_name, method_name, definition, where = topenv(parent.frame()), signature = c(class_name, "DatasetExperiment") )
class_name |
the name of the to update the method for |
method_name |
the name of the method to update. Must be an existing method for the object. |
definition |
the function to replace the method with. This function will be used when the method is called on the object. |
where |
the environment to create the object in. default where = topenv(parent.frame()) |
signature |
a list of classes that this object requires as inputs. Default is c(class_name,'DatasetExperiment') |
a method is created in the specified environment
set_struct_obj( class_name = 'add_two_inputs', struct_obj = 'model', stato = FALSE, params = c(input_1 = 'numeric', input_2 = 'numeric'), outputs = c(result = 'numeric'), prototype = list( input_1 = 0, input_2 = 0, name = 'Add two inputs', description = 'example class that adds two values together') )