krangl / krangl / DataCol

DataCol

abstract class DataCol

Constructors

<init>

DataCol(name: String)

Properties

hasNulls

val hasNulls: Boolean

length

abstract val length: Int

name

val name: String

Functions

div

open infix operator fun div(something: Number): DataCol
open infix operator fun div(something: DataCol): DataCol

divInternal

open fun divInternal(something: Any): DataCol

equals

open fun equals(other: Any?): Boolean

get

operator fun get(index: Int): Any?

hashCode

open fun hashCode(): Int

minus

open infix operator fun minus(something: Number): DataCol
open infix operator fun minus(something: DataCol): DataCol

minusInternal

open fun minusInternal(something: Any): DataCol

not

open operator fun not(): DataCol

plus

open infix operator fun plus(something: Number): DataCol
open infix operator fun plus(something: DataCol): DataCol
open infix operator fun plus(something: Iterable<*>): DataCol
infix operator fun plus(something: String): DataCol

plusInternal

open fun plusInternal(something: Any): DataCol

times

open infix operator fun times(something: Number): DataCol
open infix operator fun times(something: DataCol): DataCol

timesInternal

open infix fun timesInternal(something: Any): DataCol

toString

open fun toString(): String

unaryMinus

operator fun unaryMinus(): DataCol

values

abstract fun values(): Array<*>

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?>

Inheritors

AnyCol

class AnyCol : DataCol

BooleanCol

class BooleanCol : DataCol

DoubleCol

class DoubleCol : DataCol

NumberCol

abstract class NumberCol : DataCol

StringCol

class StringCol : DataCol