Companion

object Companion

Functions

Link copied to clipboard
fun asDouble(element: Any?): Double
Link copied to clipboard
fun column(name: String, dataType: DataType): ColumnType

Creates a column with the given data type

Link copied to clipboard
fun columnNames(number: Int, prefix: String = "C"): List<String>

Makes a list of strings containing, prefix1, prefix2,..., prefixN, where N = number

Link copied to clipboard
fun columns(numColumns: Int, dataType: DataType): Map<String, DataType>

Creates n = numColumns of columns all with the same data type, with names C1, C2, ..., Cn

fun columns(names: List<String>, dataType: DataType): Map<String, DataType>

Creates names.size() columns with the provided names and data type

Link copied to clipboard
fun createFromCSVFile(pathToCSVFile: Path, columnTypes: Map<String, DataType>, pathToOutputFile: Path = pathToCSVFile.parent.resolve( "${KSLFileUtil.removeLastFileExtension(pathToCSVFile.fileName.toString())}_TabularFile" ), hasHeader: Boolean = true): TabularOutputFile
fun createFromCSVFile(pathToCSVFile: Path, columnTypes: Map<String, DataType>, outFileName: String, hasHeader: Boolean = true): TabularOutputFile

Reads in a CSV file and converts it to a tabular output file. The separator must be a comma.

Link copied to clipboard
fun isNumeric(element: Any?): Boolean

Test if the object is any of {Double, Long, Integer, Boolean, Float, Short, Byte}

Link copied to clipboard

Creates a double column

Link copied to clipboard

Creates a text column

Link copied to clipboard

If the kType is {Double, Long, Integer, Boolean, Float, Short, Byte} then it is NUMERIC otherwise it is considered TEXT.

Link copied to clipboard

Converts the list of KType instances to a list of DataType instances. If the type is {Double, Long, Integer, Boolean, Float, Short, Byte} then it is NUMERIC otherwise it is considered TEXT.