Description Usage Arguments Details Examples
Changes the order of columns by placing a specified column to the left of another specified column.
1 |
data |
a |
... |
either a) if you are only changing one column, the current column name, followed by a comma and then the desired column name (option of NSE), or b) one or more of the following: current_column_name/desired_column_name, where the current column name is followed by a forward slash followed by your desired column name. Using the function in this way, you may change as many column names as you like in one function call. |
ref |
TRUE (default) or FALSE, if TRUE and data is a data.table, modify the data.table by reference (modifying-in-place), if FALSE, do not modify the data.table by reference, instead treat it like a data.frame (copy on modify). |
warnings |
TRUE (default) or FALSE, should warnings occur when modifications by reference occur or conversions take place? |
This function uses seperate methods for data.tables and data.frames. By
default, data.tables will be modified by reference. To turn off this
behavior, set ref
to FALSE
.
1 2 3 4 | Here is how to change a column name, where we change a column named "Jake"
into one named "Josh":
\code{changeColOrder(my_data, "Jake", "Josh")}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.