createColumn()¶
- createColumn(name, *codes)¶
Creates a new blank column with the specified name and codes.
Parameter
Type
Description
nameString
The name of the new column
codescomma separated Strings
Codes that the new column will contain.
Note
createColumn()creates the onset, offset, and ordinal codes by default. You do not need to specify them in thecodes.Returns
Ruby object representation of the new column in Datavyu.
Example
The following example creates a new Datavyu column called “trial” with the codes “trialnum” and “unit”, and assigns them to an
RColumnobject calledtrial. It then adds a new cell totrialusingmake_new_cell()and writes the changes back to the Datavyu spreadsheet usingsetColumn().require 'Datavyu_API.rb' begin trial = createColumn("trial", "trialnum", "unit") trial.make_new_cell() setColumn(trial) end
