View source: R/conditional_transform.R
conditional_transform | R Documentation |
A function to perform conditional transformations of the x/y raw data. The function takes the dataframe and performs a single axis flip based on the values specified in the cond_column. The primary use of this function is to correct or normalise the data when counterbalancing stimulus placement within experiments (e.g., having a target stimulus appear on the left and right equally often)
conditional_transform(
data,
flip = c("x", "y"),
cond_column,
cond_values,
resolution_x = 1920,
resolution_y = 1080,
message = TRUE
)
data |
a dataframe that includes columns x and y and the column specified in cond_column. Can be raw, fixation, or saccade data. |
flip |
either "x", to flip across vertical midline, or "y" to flip across horizontal midline |
cond_column |
a column name, on which the flips are conditional |
cond_values |
a single value or vector stating which values in con_column result in a flip |
resolution_x |
screen size in pixels for the x axis |
resolution_y |
screen size in pixels for the y axis |
message |
whether to output messages during function. Useful to turn off when using in a vectorised fashion where it is running multiple times |
a dataframe of the equivalent format as the input data
data <- combine_eyes(HCL)
data <- merge(data, HCL_behavioural)
conditional_transform(data, flip = "x",
cond_column = "cue_order",
cond_values = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.