Reorder

data class Reorder<T, C>(val df: DataFrame<T>, val columns: ColumnsSelector<T, C>, val inFrameColumns: Boolean)

An intermediate step of the reorder operation.

It holds the selected columns and does not reorder anything by itself. First, cast can optionally change the type of the selected columns. Then finish it with by, byDesc or byName to get a new DataFrame with the selected columns reordered.

See Grammar for more details.

For more information: See reorder on the documentation website.

Type Parameters

T

The schema marker of the DataFrame.

C

The type of the selected columns.

Constructors

Link copied to clipboard
constructor(df: DataFrame<T>, columns: ColumnsSelector<T, C>, inFrameColumns: Boolean)

Properties

Link copied to clipboard
internal val columns: ColumnsSelector<T, C>
Link copied to clipboard
internal val df: DataFrame<T>
Link copied to clipboard
internal val inFrameColumns: Boolean

Functions

Link copied to clipboard
fun <T, C, V : Comparable<V>> Reorder<T, C>.by(expression: ColumnExpression<C, V>): DataFrame<T>

Puts the columns selected by reorder in ascending order of the value of the expression and returns a new DataFrame.

Link copied to clipboard
fun <T, C, V : Comparable<V>> Reorder<T, C>.byDesc(expression: ColumnExpression<C, V>): DataFrame<T>

Puts the columns selected by reorder in descending order of the value of the expression and returns a new DataFrame.

Link copied to clipboard
fun <T, C> Reorder<T, C>.byName(desc: Boolean = false): DataFrame<T>

Puts the columns selected by reorder in lexicographic order of their names and returns a new DataFrame.

Link copied to clipboard
fun <R> cast(): Reorder<T, R>

Changes the type of the selected columns to R for the next step of the reorder operation, so the column expression in by or byDesc can use functions of this type, for example, sum() for Int columns.

Link copied to clipboard
internal fun <T, C, V : Comparable<V>> Reorder<T, C>.reorderImpl(desc: Boolean, expression: ColumnExpression<C, V>, unwrapSingleColumnGroup: Boolean = true): DataFrame<T>