moveTo

fun <T> DataFrame<T>.moveTo(newColumnIndex: Int, columns: ColumnsSelector<T, *>): DataFrame<T>

Moves the specified columns to a new position specified by newColumnIndex within the DataFrame.

Returns a new DataFrame with an updated column structure.

This can include column groups and nested columns.

See Selecting Columns.

For more information: See move on the documentation website.

This MoveTo Overload

Select or express columns using the Columns Selection DSL.

This DSL is initiated by a Columns Selector lambda, which operates in the context of the Columns Selection DSL and expects you to return a SingleColumn or ColumnSet (so, a ColumnsResolver). This is an entity formed by calling any (combination) of the functions in the DSL that is or can be resolved into one or more columns.

The Columns Selection DSL allows using Extension Properties for specifying columns type- and name-safe.

Check out: Columns Selection DSL Grammar

    

See Column Selectors on the documentation website.

Examples:

df.moveTo(0) { length and age }
df.moveTo(2) { cols(1..5) }

Parameters

newColumnIndex

The index specifying the position in the DataFrame columns where the selected columns will be moved.

columns

The Columns Selector used to select the columns of this DataFrame to move.


fun <T> DataFrame<T>.moveTo(newColumnIndex: Int, vararg columns: String): DataFrame<T>

Moves the specified columns to a new position specified by newColumnIndex within the DataFrame.

Returns a new DataFrame with an updated column structure.

This can include column groups and nested columns.

See Selecting Columns.

For more information: See move on the documentation website.

This MoveTo Overload

Select single or multiple columns using their names as Strings. (String API).

Examples:

df.moveTo(0) { length and age }
df.moveTo(2) { cols(1..5) }

Parameters

newColumnIndex

The index specifying the position in the DataFrame columns where the selected columns will be moved.

columns

The Columns Selector used to select the columns of this DataFrame to move.


fun <T> DataFrame<T>.moveTo(newColumnIndex: Int, insideGroup: Boolean, columns: ColumnsSelector<T, *>): DataFrame<T>

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

Moves the specified columns to a new position specified by newColumnIndex within the DataFrame.

Returns a new DataFrame with an updated column structure.

This can include column groups and nested columns.

See Selecting Columns.

For more information: See move on the documentation website.

This MoveTo Overload

Select or express columns using the Columns Selection DSL.

This DSL is initiated by a Columns Selector lambda, which operates in the context of the Columns Selection DSL and expects you to return a SingleColumn or ColumnSet (so, a ColumnsResolver). This is an entity formed by calling any (combination) of the functions in the DSL that is or can be resolved into one or more columns.

The Columns Selection DSL allows using Extension Properties for specifying columns type- and name-safe.

Check out: Columns Selection DSL Grammar

    

See Column Selectors on the documentation website.

Examples:

df.moveTo(0, true) { length and age }
df.moveTo(2, false) { cols(1..5) }

Parameters

newColumnIndex

The index specifying the position in the DataFrame columns where the selected columns will be moved.

insideGroup

If true, selected columns will be moved remaining inside their group, else they will be moved to the top level.

columns

The Columns Selector used to select the columns of this DataFrame to move.


fun <T> DataFrame<T>.moveTo(newColumnIndex: Int, vararg columns: ColumnReference<*>): DataFrame<T>
fun <T> DataFrame<T>.moveTo(newColumnIndex: Int, vararg columns: KProperty<*>): DataFrame<T>

Deprecated

It's recommended to migrate to the String or Extension Properties Access API https://kotlin.github.io/dataframe/apilevels.html