takeLast

open fun <C> ColumnSet<C>.takeLast(n: Int = 1): ColumnSet<C>

Take Last (Cols)

This collects the last n columns from this into a ColumnSet.

This function operates solely on columns at the top-level.

Any Access APIs can be used as receiver for these functions.

NOTE: To avoid ambiguity, takeLast is called takeLastCols when called on a ColumnGroup.

For more information: See take(Last)(Cols)(While) on the documentation website.

Check out: Grammar

Examples:

df.select{ cols{ "my" init.name}.takeLast(5) }

df.select{ takeLast(1) }

df.select{ myColumnGroup.takeLastCols(2) }

df.select{ "myColumnGroup".takeLastCols(3) }

Examples for this overload:

df.select{ colsOf<String>().takeLast(2) }

df.select{ cols{ .. }.takeLast(2) }

See also:

  • take — takes the first n columns instead.

  • takeWhile — takes the first columns while a predicate holds.

  • takeLastWhile — takes the last columns while a predicate holds.

  • dropLast — drops the last n columns.

Return

A ColumnSet containing the last n columns.

Parameters

n

The number of columns to take.


open fun ColumnsSelectionDsl<*>.takeLast(n: Int = 1): ColumnSet<*>

Take Last (Cols)

This collects the last n columns from this into a ColumnSet.

This function operates solely on columns at the top-level.

Any Access APIs can be used as receiver for these functions.

NOTE: To avoid ambiguity, takeLast is called takeLastCols when called on a ColumnGroup.

For more information: See take(Last)(Cols)(While) on the documentation website.

Check out: Grammar

Examples:

df.select{ cols{ "my" init.name}.takeLast(5) }

df.select{ takeLast(1) }

df.select{ myColumnGroup.takeLastCols(2) }

df.select{ "myColumnGroup".takeLastCols(3) }

Examples for this overload:

df.select{ takeLast(5) }

See also:

  • take — takes the first n columns instead.

  • takeWhile — takes the first columns while a predicate holds.

  • takeLastWhile — takes the last columns while a predicate holds.

  • dropLast — drops the last n columns.

Return

A ColumnSet containing the last n columns.

Parameters

n

The number of columns to take.