MoveClause

class MoveClause<T, C>(val df: DataFrame<T>, val columns: ColumnsSelector<T, C>)

An intermediate class used in the move operation.

This class itself does nothing—it is just a transitional step before specifying where to move the selected columns. It must be followed by one of the positioning methods to produce a new DataFrame with the updated column structure.

Use the following methods to finalize the move:

  • to – moves columns to a specific index.

  • toStart – moves columns to the beginning.

  • toEnd – moves columns to the end.

  • into / intoIndexed – moves columns to a new position.

  • toTop – moves columns to the top-level.

  • after – places columns after a specific column.

  • under – nests columns under a column group.

See Grammar for more details.

Constructors

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

Properties

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

Functions

Link copied to clipboard
fun <T, C> MoveClause<T, C>.after(column: ColumnSelector<T, *>): DataFrame<T>
fun <T, C> MoveClause<T, C>.after(column: String): DataFrame<T>

Moves columns, previously selected with move to the position after the specified column within the DataFrame.

fun <T, C> MoveClause<T, C>.after(column: KProperty<*>): DataFrame<T>
fun <T, C> MoveClause<T, C>.after(column: ColumnReference<*>): DataFrame<T>
Link copied to clipboard
internal fun <T, C> MoveClause<T, C>.afterOrBefore(column: ColumnSelector<T, *>, isAfter: Boolean): DataFrame<T>
Link copied to clipboard
fun <T, C> MoveClause<T, C>.before(column: ColumnSelector<T, *>): DataFrame<T>
fun <T, C> MoveClause<T, C>.before(column: String): DataFrame<T>

Moves columns, previously selected with move to the position before the specified column within the DataFrame.

Link copied to clipboard

Moves columns, previously selected with move into a new position specified by a given column path within the DataFrame.

fun <T, C> MoveClause<T, C>.into(column: String): DataFrame<T>

Moves the selected column, previously specified with move, to the top level of the DataFrame and assigns it a new name.

Link copied to clipboard

Moves columns, previously selected with move into a new position specified by a given column path within the DataFrame. Provides selected column indices.

Link copied to clipboard
internal fun <T, C> MoveClause<T, C>.moveImpl(under: Boolean = false, newPathExpression: ColumnsSelectionDsl<T>.(ColumnWithPath<C>) -> AnyColumnReference): DataFrame<T>
Link copied to clipboard
internal fun <T, C> MoveClause<T, C>.moveTo(columnIndex: Int): DataFrame<T>
Link copied to clipboard
internal fun <T, C> MoveClause<T, C>.moveToImpl(columnIndex: Int, insideGroup: Boolean): DataFrame<T>
Link copied to clipboard
fun <T, C> MoveClause<T, C>.to(columnIndex: Int): DataFrame<T>

Moves columns, previously selected with move to a new position specified by columnIndex within the DataFrame.

fun <T, C> MoveClause<T, C>.to(columnIndex: Int, insideGroup: Boolean): DataFrame<T>

Moves columns, previously selected with move to a new position specified by columnIndex. If insideGroup is true, selected columns will be moved remaining within their ColumnGroup, else they will be moved to the top level.

Link copied to clipboard
fun <T, C> MoveClause<T, C>.toEnd(): DataFrame<T>

Moves columns, previously selected with move to the DataFrame end.

fun <T, C> MoveClause<T, C>.toEnd(insideGroup: Boolean): DataFrame<T>

If insideGroup is true, moves columns previously selected with move to the end of their ColumnGroup. Else, selected columns will be moved to the end of their DataFrame (to the top-level).

Link copied to clipboard
fun <T, C> MoveClause<T, C>.toLeft(): DataFrame<T>
Link copied to clipboard
Link copied to clipboard

Moves columns, previously selected with move to the DataFrame start (on top-level).

fun <T, C> MoveClause<T, C>.toStart(insideGroup: Boolean): DataFrame<T>

If insideGroup is true, moves columns previously selected with move to the start of their ColumnGroup. Else, selected columns will be moved to the start of their DataFrame (to the top-level).

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun <T, C> MoveClause<T, C>.toTop(newColumnName: ColumnsSelectionDsl<T>.(ColumnWithPath<C>) -> String = { it.name() }): DataFrame<T>

Moves columns, previously selected with move to the top-level within the DataFrame. Moved columns name can be specified via special ColumnSelectionDsl.

Link copied to clipboard

Moves columns, previously selected with move under a new or an existing column group specified by a column path within the DataFrame.

fun <T, C> MoveClause<T, C>.under(column: String): DataFrame<T>

Moves columns, previously selected with move under a new or an existing column group within the DataFrame. If the column group doesn't exist, it will be created.