Description Usage Details Slots UOA_analysis_object Custom analysis object Analysis objects from simulations Examples
analysis_object are objects for data analysis.
1 2 3 4 5 6 | set.custom_analysis_object(class_name, slot_names)
make.custom_analysis_object(analysis_obj_class, ...)
make.simulation_analysis_object(meta_data, input, dims,
data = data.frame(NULL))
|
In the CAB package, data is typically stored in an analysis_object of which there are multiple child classes. analysis_objects are created by running a simulation or by importing some experimental data.
The parent class analysis_object does not really do anything. The real work is done by other classes that inherit from analysis_object.
analysis_objectA data.frame that contains the data.
meta_dataA list that contains the information about the experiment or simulation.
UOA_analysis_objectThe UOA_analysis_object class is made specially for the MED-PC files used at the University of Auckland.
variable_arraysA list that stores arrays that contains variable information, such as the number of responses or the number of reinforcement (i.e., a "C"-array).
general_arraysA list that stores arrays that contain general information, such as the arranged inter-reinforcement intervals.
meta_dataInerited from analysis_object. A data.frame that contains the metadata for the experiment.
analysis_objectInherited from analysis_object. A data.frame that contains the events and the times. This will be some post-processed "X"-array.
Custom analysis objectIf the user wishes to make their own analysis_object class, the set.custom_analysis_object() function can be used to set up the class.
To create an object of the newly set up analysis_object class, the make.custom_analysis_object() function can be used. In general, once a custom analysis_object class is defined, other functions, such as those that read in the data, will construct objects of the custom analysis_object class. Hence, the user will rarely have to use the make.custom_analysis_object() function directly.
set.custom_analysis_object( class_name, slot_names )
analysis_objectInherited from analysis_object.
meta_dataInherited from meta_data.
class_nameA character string giving the name of the custom analysis_object class.
slot_namesEither: 1) an unnamed list of slot names or 2) a named list, with the names specifying the slot names and the elements specifying the class of object contained in the slot. If 1), all slots will contain list. See example.
make.custom_analysis_object( analysis_obj_class, ... )
analysis_object_classA character string specifying the name of the custom analysis_object class.
...A named set of arguments that fills up the object. The arguments should be named as the slot name to which the argument pertains to. See example.
By default, simulations will store the data in a simulation_analysis_object object.
make.simulation_analysis_object( class_name, slot_names )
analysis_objectInherited from analysis_object. Defaults to data.frame(NULL) so that only the input slot contains simulation data.
meta_dataInherited from analysis_object.
inputInherited from sim_input.
1 2 3 4 5 6 7 8 9 10 | # Make a custom "analysis_object"
# With an unnamed list:
set.custom_analysis_object( class_name = "test_analysis", slot_names = list( "slot1", "slot2" ) )
# The "slot_names" is an unnamed list, so "slot1" and "slot2" will only hold "list".
make.custom_analysis_object( analysis_object_class = "test_analysis", slot1 = list(1), slot2 = list(2) )
# With a named list:
set.custom_analysis_object( class_name = "test_analysis", slot_names = list( slot1 = "data.frame", slot2 = "character" ) )
# The "slot_names" is a named list, with elements "data.frame" and "character". So, "slot1" will hold "data.frame" and "slot2" will hold "character".
make.custom_analysis_object( "test_analysis", slot1 = data.frame(1), slot2 = "a" )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.