-
Notifications
You must be signed in to change notification settings - Fork 22
createMutuallyExclusive
Takes two columns and creates a new column that combines the arguments of those two columns into one column. This merges the arguments in the cells into new cells, and will create new cells based on the onsets/offsets of cells in both columns.
The name of the resulting new column
The name of the first variable or the RVariable object of the first variable. Both are accepted.
The name of the second variable or the RVariable object of the second variable. Both are accepted.
The prefix to use for the arguments of the first variable. This will be affixed to the front of the argument names. Use this in case both columns have arguments that are named the same. By default the variable 1 name is prefixed to the argument name, so for a variable called "test" and an argument called "trialnum", the resulting argument name is "test_trialnum" in the new column.
The prefix to use for the arguments of the second variable. This will be affixed to the front of the argument names. Use this in case both columns have arguments that are named the same. By default the variable 2 name is prefixed to the argument name, so for a variable called "test" and an argument called "trialnum", the resulting argument name is "test_trialnum" in the new column.
# Get a variable called trial from the database, store it in a Ruby variable called trial
trial = getVariable("trial")
# Get another variable from the database called "walk"
walk = getVariable("walk")
# Now we want to create a new column by muxing the two together
trialwalk = createMutuallyExclusive("trial_walk", trial, walk)
# Write it back to the database
setVariable(trialwalk)