Description Usage Arguments Value Examples
View source: R/add_manual_var.R
Takes a given dataframe and adds a column for a categorical variable The dataframe must only have entries that would all have the same categorical value (i.e. only one level of the variable can be assigned) This (basically useless and arbitrary) function is for adding a label to individual trials (i.e. marking if a list of trials was in quiet or noise)
1 | add_manual_var(data, col, value)
|
data |
Dataframe. What data you want to use. Data should be in a by-trial format and all trials should have the same condition/level that you want to assign within this dataframe |
col |
Column Name. What you want the name of your variable to be. MUST BE A STRING/CHARACTER. Will also be the new column name in your dataframe |
value |
Value you want to assign ALL rows in your dataframe. MUST BE A STRING/CHARACTER. |
Returns printed dataframe to console window. Assign to variable to add in workspace
1 2 | CogLAW_with_attribute <- add_manual_var(CogLAW,"Attribute_Type","Familiar")
Will return dataframe with new column labelled "Attribute_Type"
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.