krangl / krangl / LongCol

LongCol

class LongCol : NumberCol

Constructors

<init>

LongCol(name: String, values: List<Long?>)
LongCol(name: String, values: LongArray)
LongCol(name: String, values: Array<Long?>)

Properties

length

val length: Int

values

val values: Array<Long?>

Functions

divInternal

fun divInternal(something: Any): DataCol

minusInternal

fun minusInternal(something: Any): DataCol

plusInternal

fun plusInternal(something: Any): DataCol

timesInternal

fun timesInternal(something: Any): DataCol

values

fun values(): Array<Long?>

Extension Functions

asFactor

fun DataCol.asFactor(): DataCol

asType

fun <R> DataCol.asType(): Array<R?>

cumSum

Calculates the cumulative sum of the column values.

fun DataCol.cumSum(): DataCol

desc

Creates a sorting attribute that inverts the order of the argument

fun DataCol.desc(): IntCol

eq

infix fun DataCol.eq(i: Any): BooleanArray

ge

infix fun DataCol.ge(i: Number): BooleanArray
infix fun DataCol.ge(i: DataCol): BooleanArray

greaterEqualsThan

fun DataCol.greaterEqualsThan(i: Number): BooleanArray
fun DataCol.greaterEqualsThan(i: DataCol): BooleanArray

greaterThan

fun DataCol.greaterThan(i: Number): BooleanArray
fun DataCol.greaterThan(i: DataCol): BooleanArray

gt

infix fun DataCol.gt(i: Number): BooleanArray
infix fun DataCol.gt(i: DataCol): BooleanArray

isEqualTo

infix fun DataCol.isEqualTo(i: Any): BooleanArray

isMatching

Match a text column in a NA-aware manner to create a predicate vector for filtering.

fun <T> DataCol.isMatching(missingAs: Boolean = false, filter: T.() -> Boolean): BooleanArray

isNA

Maps a column to true for the NA values and false otherwise.

fun DataCol.isNA(): BooleanArray

isNotNA

fun DataCol.isNotNA(): BooleanArray

lag

Returns the "previous" column values. Useful for comparing values behind the current values.

fun DataCol.lag(n: Int = 1, default: Any? = null): DataCol

le

infix fun DataCol.le(i: Number): BooleanArray
infix fun DataCol.le(i: DataCol): BooleanArray

lead

Returns the "next" column values. Useful for comparing values ahead of the current values.

fun DataCol.lead(n: Int = 1, default: Any? = null): DataCol

lesserEquals

fun DataCol.lesserEquals(i: Number): BooleanArray
fun DataCol.lesserEquals(i: DataCol): BooleanArray

lesserThan

fun DataCol.lesserThan(i: Number): BooleanArray
fun DataCol.lesserThan(i: DataCol): BooleanArray

lt

infix fun DataCol.lt(i: Number): BooleanArray
infix fun DataCol.lt(i: DataCol): BooleanArray

map

Allows to transform column data into list of same length ignoring missing values, which are kept but processing can be done in a non-null manner.

fun <T> DataCol.map(expr: (T) -> Any?): List<Any?>

max

Calculates the maximum of the column values.

fun DataCol.max(removeNA: Boolean = false): Double?

mean

Calculates the arithmetic mean of the column values.

fun DataCol.mean(removeNA: Boolean = false): Double?

median

Calculates the median of the column values.

fun DataCol.median(removeNA: Boolean = false): Double?

min

Calculates the minimum of the column values.

fun DataCol.min(removeNA: Boolean = false): Double?

order

rank returns the order of each element in an ascending list

fun DataCol.order(naLast: Boolean = true): List<Int>

pctChange

Calculates the percentage change between the current and a prior column value.

fun DataCol.pctChange(): DataCol

rank

fun DataCol.rank(naLast: Boolean = true): List<Int>

sd

Calculates the standard deviation of the column values.

fun DataCol.sd(removeNA: Boolean = false): Double?

sum

Calculates the arithmetic mean of the column values.

fun DataCol.sum(removeNA: Boolean = false): Number?

toBooleans

fun DataCol.toBooleans(): Array<Boolean?>

toDoubles

fun DataCol.toDoubles(): Array<Double?>

toInts

fun DataCol.toInts(): Array<Int?>

toLongs

fun DataCol.toLongs(): Array<Long?>

toStrings

fun DataCol.toStrings(): Array<String?>