Description Usage Arguments Details Value Author(s) References Examples
Shuffle the order of a vector around using natural language statements.
1 | moveMe(invec, movecommand)
|
invec |
The input vector |
movecommand |
The command that describes how you want to shuffle the vector. See Details. |
This can be a useful function for reordering the columns of a
data.frame
or data.table
in a convenient manner. In such
cases, the invec
would be names(your_data_frame)
. When using
data.table
s, remember to use setcolorder
to avoid copying.
The movecommand
argument is specified in the form of "a, b
before f"
. The positions to move are:
first: move the specified items to the first postion.
last: move the specified items to the last position.
before: move the specified items before the value mentioned.
after: move the specified items after the value mentioned.
Multiples are allowed:
Specify multiple values to be moved by separating them with a comma.
Chain multiple move commands by separating them with a semicolon.
A vector.
Ananda Mahto
http://stackoverflow.com/a/18420673/1270695
1 2 3 4 5 6 7 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.