createColumn()¶
- createColumn(name, *codes)¶
Creates a new blank column with the specified name and codes.
Parameter
Type
Description
name
String
The name of the new column
codes
comma 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
RColumn
object calledtrial
. It then adds a new cell totrial
usingmake_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