Description Usage Arguments Value Examples
a helper function to update methods for a struct object
1 2 3 4 5 6 7 | 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
1 2 3 4 5 6 7 8 9 10 11 12 | 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')
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.