Newer
Older
\name{reorderColumns}
\alias{reorderColumns}
\title{Reorder the columns of a dataframe}
\usage{
reorderColumns(df, columnOrder)
}
\arguments{
\item{df}{The input dataframe.}
\item{columnOrder}{A vector specifying the desired order of columns.}
}
\value{
A dataframe with columns reordered according to the specified column order.
}
\description{
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)
}