get_cell_from_time()

Identifies the cell that occurs at a given point in time for the
specified column, and returns it.

Parameter

Type

Description

col

String or RColumn object

Name or Ruby representation of the column that you are
looking for a cell within.

time

Integer

Time (in milliseconds) that you want to identify the cell
that happens then.

Returns

Returns the Ruby representation of the cell at the specified
point in time. If there is no cell at that point in time, Ruby
does not return anything.

Example

The following example identifies the cell that occurs at 100ms
in the “trial” column, and assigns it to a RCell object.
It then prints out the cell’s ordinal, onset, and offset codes
for easy location.

require'Datavyu_API.rb'begintrial=getColumn("trial")cell=get_cell_from_time(trial,100)# Get the ordinal, onset, offset# values from the cell, and assign them to# string variables, so we can print them outordinal=cell.ordinal.to_sonset=cell.onset.to_soffset=cell.offset.to_s# Print out ordinal, onset, and offset, and their valuesputs"ordinal: #{ordinal}"puts"onset: #{onset}ms"puts"offset: #{offset}ms"end

This material is based on work supported by the National Science Foundation under Grant No. BCS-1238599 and the Eunice Kennedy Shriver National Institute of Child Health and Human Development under Cooperative Agreement U01-HD-076595. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation or the Eunice Kennedy Shriver National Institute of Child Health and Human Development.