Skip to content
Snippets Groups Projects
reorderColumns.Rd 748 B
Newer Older
Arnaud Duvermy's avatar
Arnaud Duvermy committed
% Generated by roxygen2: do not edit by hand
Arnaud Duvermy's avatar
Arnaud Duvermy committed
% Please edit documentation in R/utils.R
Arnaud Duvermy's avatar
Arnaud Duvermy committed
\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)
}