Description Usage Arguments Examples
Re-arrange a dataframe by moving columns. You can use partial match to
select the columns of interest (See get_col_indexes
).
1 | move_columns(x, columns, position)
|
x |
A dataframe. |
columns |
A vector containing column names. You can use partial matching and regular expressions. |
position |
Either a text or a number. Accepted values include "start" to move the columns in the begining of the dataframe, dataframe, "end" to move to the end or a number to specify the position that the columns will move (move after this number). See examples. |
1 2 3 4 5 6 7 | x <- data.frame(V1 = c("a", "b", "c"),
V2 = c("A", "B", "C"),
Z3 = c("c", "d", "e"))
move_columns(x, "V1", 2)
move_columns(x, "1$", 2)
move_columns(x, "^Z", "start")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.