Skip to content
This repository has been archived by the owner on Aug 30, 2019. It is now read-only.

createVariable

smidget edited this page Jul 19, 2012 · 3 revisions

Purpose

To create a new variable to use in OpenSHAPA. NOTE: This function simple creates a new RVariable with a list of arguments, it does not write that variable back to the OpenSHAPA 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 OpenSHAPA DB
setVariable(trial)
setVariable(comments)