createColumn()

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 the codes.

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 called trial. It then adds a new cell to trial using make_new_cell and writes the changes back to the Datavyu spreadsheet using setColumn.

require 'Datavyu_API.rb'
begin
   trial = createColumn("trial", "trialnum", "unit")
   trial.make_new_cell()
   setColumn(trial)
end