under

Inserts the new column previously specified with insert under the selected column group.

This works for existing column groups, as well as for ones that don't exist yet; in that case, they will be created.

For more information: See insert on the documentation website.

See Grammar for more details.

See SelectingColumns.ColumnsSelectionDsl.

Examples

// Insert a new column "age" under the column group with path ("info", "personal")
df.insert(age).under { info.personal }

// Insert a new column "age" under the previously-nonexistent column group with path ("info", "extraData")
df.insert(age).under { info.colGroup("extraData") }

// Insert a new column "sum" under the only top-level column group
val dfWithSum = df.insert("sum") { a + b }.under { colGroups().single() }

Return

A new DataFrame with the inserted column placed under the selected group.

Parameters

column

The ColumnSelector used to choose a new or existing column group in this DataFrame under which the new column will be inserted.


fun <T> InsertClause<T>.under(column: String): DataFrame<T>

Inserts the new column previously specified with insert under the given column group by its name.

If the column group with the provided name does not exist, it will be created automatically.

For more information: See insert on the documentation website.

See Grammar for more details.

Example

// Insert a new column "age" under the "info" column group.
df.insert(age).under("info")

Return

A new DataFrame with the inserted column placed under the specified column group.

Parameters

column

The name of the column group in this DataFrame. If the group does not exist, it will be created.


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.

See Selecting Columns.

For more information: See move on the documentation website.

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

Examples:

df.move("age", "weight").under("info")
df.move { age and weight }.under("info")

Parameters

column

The String name of the ColumnGroup in the DataFrame the selected columns will be moved under.


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

If the specified path is partially or fully missing — that is, if any segment of the path does not correspond to an existing column or column group — all missing parts will be created automatically.

See Selecting Columns.

For more information: See move on the documentation website.

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:

// move under an existing column group
df.move { age and weight }.under { info }
// move under a new column group
df.move { age and weight }.under { columnGroup(info) }

Parameters

column

The ColumnsSelector that defines the path to a ColumnGroup in the DataFrame, where the selected columns will be moved.


fun <T> InsertClause<T>.under(columnPath: ColumnPath): DataFrame<T>

Deprecated (with error)

This `ColumnPath` overload is deprecated in favor of `.under { path }`. Will be ERROR in 1.0.

Replace with

this.under { columnPath }

DEPRECATED:

Use insert {}.under { columnPath } instead.

See Grammar for more details.


fun <T> InsertClause<T>.under(column: KProperty<*>): DataFrame<T>

Deprecated

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