Skip to content

createVariable

Jesse Lingeman edited this page Mar 6, 2013 · 4 revisions

Purpose

To create a new variable to use in Datavyu. NOTE: This function simple creates a new RVariable with a list of arguments, it does not write that variable back to the Datavyu database unless you write it back with setVariable.

Parameters

Name

The name of the new variable

Arguments* (optional)

A list of arguments to add to the column upon creation. Note: onset, offset, and ordinal are mandatory arguments and will always be added. If this is left blank, a single argument called "var" will be added. You can add as many arguments as you'd like here. See below for syntax.

Examples

# Create a new variable called "trial" with some arguments
trial = createVariable("trial", "trialnum", "unit", "condition")

# Create a new variable called comments with no arguments
# This creates a new column with only a "var" argument that can be used.
comments = createVariable("comments")

# You can add cells and what not here if you want to

# Write it back to the Datavyu DB
setVariable(trial)
setVariable(comments)