rowMaxOfOrNull

inline fun <reified T : Comparable<T>> DataRow<*>.rowMaxOfOrNull(skipNaN: Boolean = skipNaNDefault): T?

Returns the maximum of the values of type T in this DataRow, or null if there is nothing to compare.

Only the values in the columns of type T (or T?) are taken into account; all other columns of the row are ignored.

Columns inside column groups are also excluded. To include those in the maximum, flatten the DataFrame first.

Only self-comparable values are supported: values of a type T : Comparable<T> that are mutually comparable (like strings, primitive numbers, or dates). This includes all primitive number types, but no mix of different number types, which would result in a ClassCastException.

null values in the input are always ignored.

If the input contains NaN values, the result will be NaN, unless skipNaN is set to true.

Returns null when there is nothing left to compare, for instance when the input is empty or contains only null (or, if skipNaN is true, only null and NaN) values.

The result has the same type as the input values (minus nullability, if the input values were nullable).

For more information about the resulting types: See "min / max Type Conversion" on the documentation website.

See also:

For more information: See "Row statistics" on the documentation website.

Example

// The largest of all `Int` values in the first row, or `null` if there are none
df[0].rowMaxOfOrNull<Int>()

Return

The largest value of type T in this row, or null if there are no values to compare.

Parameters

skipNaN

If true, NaN values are ignored, just like null values. If false (the default), a NaN in the input is propagated to the result. This only has an effect on Double and Float values.

Type Parameters

T

The type of the values to compare. Only columns of this type are taken into account.