Reorder the columns of a dataframe
reorderColumns.Rd
This function reorders the columns of a dataframe according to the specified column order.
Examples
# Example dataframe
df <- data.frame(A = 1:3, B = 4:6, C = 7:9)
# Define the desired column order
columnOrder <- c("B", "C", "A")
# Reorder the columns of the dataframe
df <- reorderColumns(df, columnOrder)