Given a melted data frame and a definition for the new variable, create that new variable added onto the melted data frame.
1 | make_new_var(new_var_name, definition, data = get_data())
|
new_var_name |
character. The desired name of the new variable. |
definition |
numeric or character. The values for the new variable. |
data. |
The data to which the new variable will be added. This is assumed to be a three column melted dataframe, using reshape2 <http://cran.r-project.org/web/packages/reshape2/index.html>. The first column should contain IDs, the second column should contain variable names, and the third column should contain variable values. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.