Reorder the columns of a data frame.
move_columns_to_front(df, columns)
df | The data frame that shall be reordered. |
---|---|
columns | One or multiple column names that should be moved to the front of the dataframe. Order is kept. |
Data frame with reordered columns.
Sets the desired columns
of the dataframe df
to the first columns. Does not change the order of the others.
## move_columns_to_fron(df, c("new_first_column", "new_second_column"))