##### FORMULA

    Dark Mode
Search:
Group by:

Types

ValueKind = enum
  VNull, VBool, VInt, VFloat, VString, VObject
Value = object
  case kind*: ValueKind
  of VString:
      str*: string

  of VInt:
      num*: BiggestInt

  of VFloat:
      fnum*: float

  of VBool:
      bval*: bool

  of VObject:
      fields*: OrderedTable[string, Value]

  of VNull:
      nil

  
FormulaKind = enum
  fkTerm, fkVariable, fkFunction
VectorValuedFunc = proc (s: PersistentVector[Value]): Value
ScalarValuedFunc = proc (s: Value): Value
FuncKind = enum
  funcVector, funcScalar
ArithmeticKind = enum
  amPlus = "+", amMinus = "-", amMul = "*", amDiv = "/", amDep = "~", amEqual = "==",
  amUnequal = "!=", amGreater = ">", amLess = "<", amGeq = ">=", amLeq = "<=", amAnd = "and",
  amOr = "or", amXor = "xor"
FormulaNode = ref FormulaNodeObj
DataFrame = object
  len*: int
  data*: OrderedTable[string, PersistentVector[Value]]
  case kind: DataFrameKind
  of dfGrouped:
      groupMap: OrderedTable[string, HashSet[Value]]

  else:
    nil
  

Procs

proc getKeys[T](tab: OrderedTable[string, T]): seq[string]
returns the keys of the table as a seq
proc getKeys(df: DataFrame): seq[string] {...}{.raises: [], tags: [].}
returns the keys of a data frame as a seq
proc add(v: PersistentVector[Value]; w: PersistentVector[Value]): PersistentVector[
    Value] {...}{.raises: [], tags: [].}
adds all elements of w to v and returns the resulting vector
proc `%~`(c: char): Value {...}{.raises: [], tags: [].}
we convert a char to a string!
proc `%~`(v: string): Value {...}{.raises: [], tags: [].}
proc `%~`(v: SomeFloat): Value
proc `%~`(v: SomeInteger): Value
proc `%~`(v: bool): Value {...}{.raises: [], tags: [].}
proc `%~`(v: OrderedTable[string, Value]): Value {...}{.raises: [], tags: [].}
proc newVObject(): Value {...}{.raises: [], tags: [].}
proc `%~`[T: not Value](s: openArray[T]): seq[Value]
converts a seq[T] to a seq[Value]
proc `[]`(df: DataFrame; k: string): PersistentVector[Value] {...}{.inline,
    raises: [KeyError], tags: [].}
proc `[]`(df: DataFrame; k: string; idx: int): Value {...}{.inline, raises: [KeyError], tags: [].}
returns the element at index idx in column k directly, without returning the whole vector first
proc `[]`(df: DataFrame; k: string; slice: Slice[int]): seq[Value] {...}{.inline,
    raises: [KeyError], tags: [].}
returns the elements in slice in column k directly, without returning the whole vector first
proc `[]=`(df: var DataFrame; k: string; vec: PersistentVector[Value]) {...}{.inline,
    raises: [], tags: [].}
proc `[]=`[T](df: var DataFrame; k: string; data: openArray[T]) {...}{.inline.}
Extends the given DataFrame by the column k with the data. This proc raises if the given data length if not the same as the DataFrames' length. In case k already exists, data will override the current content!
proc `[]=`(df: var DataFrame; k: string; idx: int; val: Value) {...}{.inline,
    raises: [KeyError], tags: [].}
proc `[]`(v: Value; key: string): Value {...}{.inline, raises: [KeyError], tags: [].}
proc `[]=`(v: var Value; key: string; val: Value) {...}{.inline, raises: [], tags: [].}
proc `[]`[T, U](df: DataFrame; rowSlice: HSlice[T, U]): DataFrame
returns the vertical slice of the data frame given by rowSlice.
proc row(df: DataFrame; idx: int; cols: varargs[string]): Value {...}{.inline,
    raises: [KeyError], tags: [].}
Returns the row idx of the DataFrame df as a Value of kind VObject. If cols are given, only those columns will appear in the resulting Value.
proc contains(df: DataFrame; key: string): bool {...}{.raises: [], tags: [].}
Contains proc for DataFrames, which checks if the key names a column in the DataFrame
proc contains(v: Value; key: string): bool {...}{.raises: [], tags: [].}
proc pretty(v: Value; precision = 4; emphStrNumber = true): string {...}{.
    raises: [Exception, ValueError], tags: [RootEffect].}
converts the given value to its value as a string. For VFloat the precision can be given. If emphStrNumber is true, a number stored as a string will be emphasized by enclosing it with explicit ". This is mainly for printing DFs to show the user if a number is a number or a string.
proc hash(x: Value): Hash {...}{.raises: [], tags: [].}
proc toFloat(v: Value; allowNull: static bool = false): float
proc toInt(v: Value): BiggestInt {...}{.raises: [], tags: [].}
Converts a numeric value to an int. If the value is a float we round and convert to int
proc toBool(v: Value): bool {...}{.raises: [], tags: [].}
Checks if the value is a bool and returns its value
proc toStr(v: Value): string {...}{.raises: [Exception, ValueError], tags: [RootEffect].}
Returns the value v as a string. If the value is of kind VString, no conversion is required. This however will fail, if the input is of type
  • VNull
  • VObject

if you want string representations of those value types, use $

proc `==`(v, w: Value): bool {...}{.raises: [KeyError], tags: [].}
checks whether the values are equal. Note: if both values are numbers of different kind (VInt and VFloat) the values are both compared as floats! The float comparison happens with a floating point comparison with relatively large epsilon (1-e8).
proc `<`(v, w: Value): bool {...}{.raises: [KeyError, Exception], tags: [].}
checks whether the v is smaller than w Note: this is only defined for a subset of the possible types! Note2: if both are numbers of different kind (VInt and VFloat) the values are compared as a float! For very large values this would be problematic, but here we are lenient and assume the user uses Value for small calculations!
proc `<=`(v, w: Value): bool {...}{.raises: [KeyError, Exception], tags: [].}
checks whether v is smaller or equal than w
proc `+`(v`gensym557876, w`gensym557877: Value): Value {...}{.raises: [Exception], tags: [].}
Adds two Values together, if they are addeable. These operations only work for VInt and VFloat. VInt is converted to floats for the calculation. The result is always a VFloat!
proc `-`(v`gensym558023, w`gensym558024: Value): Value {...}{.raises: [Exception], tags: [].}
Adds two Values together, if they are addeable. These operations only work for VInt and VFloat. VInt is converted to floats for the calculation. The result is always a VFloat!
proc `*`(v`gensym558223, w`gensym558224: Value): Value {...}{.raises: [Exception], tags: [].}
Adds two Values together, if they are addeable. These operations only work for VInt and VFloat. VInt is converted to floats for the calculation. The result is always a VFloat!
proc `/`(v`gensym558423, w`gensym558424: Value): Value {...}{.raises: [Exception], tags: [].}
Adds two Values together, if they are addeable. These operations only work for VInt and VFloat. VInt is converted to floats for the calculation. The result is always a VFloat!
proc pretty(df: DataFrame; numLines = 20; precision = 4; header = true): string {...}{.
    raises: [Exception, ValueError, KeyError], tags: [RootEffect].}
converts the first numLines to a table. If the numLines argument is negative, will print all rows of the dataframe. The precision argument is relevant for VFloat values, but can also be (mis-) used to set the column width, e.g. to show long string columns. The header is the Dataframe with ... information line, which is not part of the returned values for simplicity if the output is to be assigned to some variable. TODO: we could change that (current way makes a test case easier...) TODO: need to improve printing of string columns if length of elements more than alignBy.
proc toUgly(result: var string; node: FormulaNode) {...}{.raises: [Exception, ValueError],
    tags: [RootEffect].}
proc `$`(node: FormulaNode): string {...}{.raises: [Exception, ValueError],
                                  tags: [RootEffect].}
Converts node to its string representation
proc toVector[T: not Value](s: openArray[T]): PersistentVector[Value]
proc toVector(s: seq[Value]): PersistentVector[Value] {...}{.raises: [], tags: [].}
the overload of toVector, which simply calls toPersistentVector directly
proc extendShortColumns(df: var DataFrame) {...}{.raises: [KeyError], tags: [].}
initial calls to seqsToDf and other procs may result in a ragged DF, which has less entries in certain columns than the data frame length. This proc fills up the mutable dataframe in those columns
proc toDf(t: OrderedTable[string, seq[string]]): DataFrame {...}{.raises: [KeyError],
    tags: [].}
creates a data frame from a table of seq[string] NOTE: This proc assumes that the given entries in the seq[string] have been cleaned of white space. The readCsv proc takes care of this. TODO: currently does not allow to parse bool!
proc toDf(t: OrderedTable[string, seq[Value]]): DataFrame {...}{.raises: [KeyError],
    tags: [].}
creates a data frame from a table of seq[Value]. Simply have to convert the seq[Value] to a PersistentVector[Value] and add to DF.
proc vToSeq(v: PersistentVector[Value]): seq[Value] {...}{.raises: [], tags: [].}
proc vToSeq(df: DataFrame; key: string): seq[Value] {...}{.raises: [KeyError], tags: [].}
proc toFloat(s: string): float {...}{.raises: [ValueError], tags: [].}
proc filter(df: DataFrame; conds: varargs[FormulaNode]): DataFrame {...}{.
    raises: [Exception, KeyError], tags: [RootEffect].}
returns the data frame filtered by the conditions given
proc length(v: PersistentVector[Value]): Value {...}{.raises: [], tags: [].}
returns the length of the given vector (DF column) as a Value. Essentially just a working version of len for use in formulas, e.g. for summarize. Does not use the len name for two reasons:
  1. Nim does not allow overload by return type
  2. length is the name in R
proc mean(v`gensym570824: PersistentVector[Value]): Value {...}{.raises: [], tags: [].}
proc sum(v`gensym572202: PersistentVector[Value]): Value {...}{.raises: [], tags: [].}
proc abs(v`gensym573402: Value): Value {...}{.raises: [], tags: [].}
proc min(v`gensym573602: PersistentVector[Value]): Value {...}{.raises: [], tags: [].}
proc max(v`gensym574802: PersistentVector[Value]): Value {...}{.raises: [], tags: [].}
proc sqrt(v`gensym576002: Value): Value {...}{.raises: [], tags: [].}
proc cbrt(v`gensym576202: Value): Value {...}{.raises: [], tags: [].}
proc log10(v`gensym576402: Value): Value {...}{.raises: [], tags: [].}
proc log2(v`gensym576602: Value): Value {...}{.raises: [], tags: [].}
proc ln(v`gensym576802: Value): Value {...}{.raises: [], tags: [].}
proc exp(v`gensym577002: Value): Value {...}{.raises: [], tags: [].}
proc arccos(v`gensym577202: Value): Value {...}{.raises: [], tags: [].}
proc arcsin(v`gensym577402: Value): Value {...}{.raises: [], tags: [].}
proc arctan(v`gensym577602: Value): Value {...}{.raises: [], tags: [].}
proc cos(v`gensym577802: Value): Value {...}{.raises: [], tags: [].}
proc cosh(v`gensym578002: Value): Value {...}{.raises: [], tags: [].}
proc sin(v`gensym578202: Value): Value {...}{.raises: [], tags: [].}
proc sinh(v`gensym578402: Value): Value {...}{.raises: [], tags: [].}
proc tan(v`gensym578602: Value): Value {...}{.raises: [], tags: [].}
proc tanh(v`gensym578802: Value): Value {...}{.raises: [], tags: [].}
proc erf(v`gensym579002: Value): Value {...}{.raises: [], tags: [].}
proc erfc(v`gensym579202: Value): Value {...}{.raises: [], tags: [].}
proc lgamma(v`gensym579402: Value): Value {...}{.raises: [], tags: [].}
proc tgamma(v`gensym579602: Value): Value {...}{.raises: [], tags: [].}
proc trunc(v`gensym579802: Value): Value {...}{.raises: [], tags: [].}
proc floor(v`gensym580002: Value): Value {...}{.raises: [], tags: [].}
proc ceil(v`gensym580202: Value): Value {...}{.raises: [], tags: [].}
proc degToRad(v`gensym580402: Value): Value {...}{.raises: [], tags: [].}
proc radToDeg(v`gensym580602: Value): Value {...}{.raises: [], tags: [].}
proc constructVariable(n: NimNode; identIsVar: static bool = true): NimNode
proc constructFunction(n: NimNode): NimNode {...}{.raises: [], tags: [].}
proc unique(v: PersistentVector[Value]): seq[Value] {...}{.raises: [KeyError], tags: [].}
returns a seq of all unique values in v
proc mutate(df: DataFrame; fns: varargs[FormulaNode]): DataFrame {...}{.
    raises: [KeyError, Exception, ValueError], tags: [RootEffect].}
Returns the data frame with an additional mutated column, described by the functions fns. Each formula fn given will be used to create a new column in the dataframe. We assume that the LHS of the formula corresponds to a fkVariable that's used to designate the new name.
proc transmute(df: DataFrame; fns: varargs[FormulaNode]): DataFrame {...}{.
    raises: [KeyError, Exception, ValueError], tags: [RootEffect].}
Returns the data frame cut to the columns created by fns, which should involve a calculation. To only cut to one or more columns use the select proc. A function may only contain a fkVariable in order to keep the column without modification. We assume that the LHS of the formula corresponds to a fkVariable that's used to designate the new name.
proc select[T: string | FormulaNode](df: DataFrame; cols: varargs[T]): DataFrame
Returns the data frame cut to the names given as cols. The argument may either be the name of a column as a string, or a FormulaNode describing either a selection with a name applied in form of an "equation" (c/f mpg dataset): mySelection ~ hwy or just an fkVariable stating the name of the column. Using the former approach it's possible to select and rename a column at the same time. Note that the columns will be ordered from left to right given by the order of the cols argument!
proc rename(df: DataFrame; cols: varargs[FormulaNode]): DataFrame {...}{.
    raises: [KeyError], tags: [].}
Returns the data frame with the columns described by cols renamed to the names on the LHS of the given FormulaNode. All other columns will be left untouched. Note that the renamed columns will be stacked on the right side of the data frame! NOTE: The operator between the LHS and RHS of the formulas does not have to be ~, but for clarity it should be.
proc arrange(df: DataFrame; by: seq[string]; order = SortOrder.Ascending): DataFrame {...}{.
    raises: [KeyError, Exception], tags: [].}
sorts the data frame in ascending / descending order by key by
proc arrange(df: DataFrame; by: string; order = SortOrder.Ascending): DataFrame {...}{.
    raises: [KeyError, Exception], tags: [].}
proc innerJoin(df1, df2: DataFrame; by: string): DataFrame {...}{.
    raises: [KeyError, Exception], tags: [].}
returns a data frame joined by the given key by in such a way as to only keep rows found in both data frames
proc setDiff(df1, df2: DataFrame; symmetric = false): DataFrame {...}{.raises: [KeyError],
    tags: [].}
returns a DataFrame with all elements in df1 that are not found in df2. If symmetric is true, the symmetric difference of the dataset is returned, i.e. elements which are either not in df1 or not in df2. NOTE: Currently simple implementation based on HashSet. Iterates both dataframes once to generate sets, calcualtes intersection and returns difference as new DataFrame Considers whole rows for comparison. The result is potentially unsorted!
proc group_by(df: DataFrame; by: varargs[string]; add = false): DataFrame {...}{.
    raises: [KeyError], tags: [].}
returns a grouped data frame grouped by all keys by A grouped data frame is a lazy affair. It only calculates the groups, but unless e.g. summarize is called on it, remains unchanged. If df is already a grouped data frame and add is true, the groups given by by will be added as additional groups!
proc summarize(df: DataFrame; fns: varargs[FormulaNode]): DataFrame {...}{.
    raises: [Exception, ValueError, KeyError], tags: [RootEffect].}
returns a data frame with the summaries applied given by fn. They are applied in the order in which they are given
proc count(df: DataFrame; col: string; name = "n"): DataFrame {...}{.
    raises: [KeyError, Exception], tags: [].}
counts the number of elements per type in col of the data frame. Basically a shorthand for df.group_by.summarize(f{length(col)}). TODO: handle already grouped dataframes.
proc bind_rows(dfs: varargs[(string, DataFrame)]; id: string = ""): DataFrame {...}{.
    raises: [KeyError], tags: [].}
bind_rows combines several data frames row wise (i.e. data frames are stacked on top of one another). If a given column does not exist in one of the data frames, the corresponding rows of the data frame missing it, will be filled with VNull.
proc add(df: var DataFrame; dfToAdd: DataFrame) {...}{.raises: [KeyError], tags: [].}
The simplest form of "adding" a data frame. If the keys match exactly or df is empty dfToAdd will be stacked below. This makes a key check and then calls bind_rows for the job.
proc head(df: DataFrame; num: int): DataFrame {...}{.raises: [KeyError], tags: [].}
returns the head of the DataFrame. num elements
proc tail(df: DataFrame; num: int): DataFrame {...}{.raises: [KeyError], tags: [].}
returns the tail of the DataFrame. num elements
proc gather(df: DataFrame; cols: varargs[string]; key = "key"; value = "value";
           dropNulls = false): DataFrame {...}{.raises: [KeyError], tags: [].}
gathers the cols from df and merges these columns into two new columns where the key column contains the name of the column from which the value entry is taken. I.e. transforms cols from wide to long format.
proc unique(df: DataFrame; cols: varargs[string]): DataFrame {...}{.raises: [KeyError],
    tags: [].}
returns a DF with only distinct rows. If one or more cols are given the uniqueness of a row is only determined based on those columns. By default all columns are considered. NOTE: The corresponding dplyr function is distinct. The choice for unique was made, since distinct is a keyword in Nim!
proc `:~`[T, U](x`gensym651432: T; y`gensym651433: U): FormulaNode
proc `:~`[T](lhs`gensym651436: FormulaNode; y`gensym651437: T): FormulaNode
proc `:~`[T](x`gensym651439: T; rhs`gensym651440: FormulaNode): FormulaNode
proc `:=`[T, U](x`gensym651469: T; y`gensym651470: U): FormulaNode
proc `:=`[T](lhs`gensym651473: FormulaNode; y`gensym651474: T): FormulaNode
proc `:=`[T](x`gensym651476: T; rhs`gensym651477: FormulaNode): FormulaNode
proc equal[T, U](x`gensym651506: T; y`gensym651507: U): FormulaNode
proc equal[T](lhs`gensym651510: FormulaNode; y`gensym651511: T): FormulaNode
proc equal[T](x`gensym651513: T; rhs`gensym651514: FormulaNode): FormulaNode
proc `:>`[T, U](x`gensym651543: T; y`gensym651544: U): FormulaNode
proc `:>`[T](lhs`gensym651547: FormulaNode; y`gensym651548: T): FormulaNode
proc `:>`[T](x`gensym651550: T; rhs`gensym651551: FormulaNode): FormulaNode
proc greater[T, U](x`gensym651580: T; y`gensym651581: U): FormulaNode
proc greater[T](lhs`gensym651584: FormulaNode; y`gensym651585: T): FormulaNode
proc greater[T](x`gensym651587: T; rhs`gensym651588: FormulaNode): FormulaNode
proc `:<`[T, U](x`gensym651617: T; y`gensym651618: U): FormulaNode
proc `:<`[T](lhs`gensym651621: FormulaNode; y`gensym651622: T): FormulaNode
proc `:<`[T](x`gensym651624: T; rhs`gensym651625: FormulaNode): FormulaNode
proc less[T, U](x`gensym651654: T; y`gensym651655: U): FormulaNode
proc less[T](lhs`gensym651658: FormulaNode; y`gensym651659: T): FormulaNode
proc less[T](x`gensym651661: T; rhs`gensym651662: FormulaNode): FormulaNode
proc `:>=`[T, U](x`gensym651691: T; y`gensym651692: U): FormulaNode
proc `:>=`[T](lhs`gensym651695: FormulaNode; y`gensym651696: T): FormulaNode
proc `:>=`[T](x`gensym651698: T; rhs`gensym651699: FormulaNode): FormulaNode
proc geq[T, U](x`gensym651728: T; y`gensym651729: U): FormulaNode
proc geq[T](lhs`gensym651732: FormulaNode; y`gensym651733: T): FormulaNode
proc geq[T](x`gensym651735: T; rhs`gensym651736: FormulaNode): FormulaNode
proc `:<=`[T, U](x`gensym651765: T; y`gensym651766: U): FormulaNode
proc `:<=`[T](lhs`gensym651769: FormulaNode; y`gensym651770: T): FormulaNode
proc `:<=`[T](x`gensym651772: T; rhs`gensym651773: FormulaNode): FormulaNode
proc leq[T, U](x`gensym651802: T; y`gensym651803: U): FormulaNode
proc leq[T](lhs`gensym651806: FormulaNode; y`gensym651807: T): FormulaNode
proc leq[T](x`gensym651809: T; rhs`gensym651810: FormulaNode): FormulaNode
proc evaluate[T](node: var FormulaNode; data: T; idx: int): Value
proc evaluate[T](node: var FormulaNode; data: T): Value
evaluation of a data frame under a given FormulaNode. This is a reducing operation. It returns a single value from a whole data frame (by working on a single column)

Funcs

func high(df: DataFrame): int {...}{.raises: [], tags: [].}
func isNumber(s: string): bool {...}{.raises: [], tags: [].}
returns true, if s is a number according to our rules:
  • starts with {0..9}
  • ends with {0..9}
  • may contain a single .
  • may contain a single e, E
  • may contain one minus, one plus at beginning and one for exponent
  • else may only contain {0..9}
  • e, +, -, . may not appear one after another
  • may contain space before and after the number

It is only used to decide whether the stringifaction of s will be surrounded by ".

func isNumber(v: Value): bool {...}{.raises: [], tags: [].}
func isInt(s: string): bool {...}{.raises: [], tags: [].}
simple "most likely int" check. If the string only contains digits and _ we consider it an Int
func isInt(v: Value): bool {...}{.raises: [], tags: [].}
checks whether the string contained in Value is likely an integer For an isFloat equivalent see isNumber.
func isNull(v: Value): Value {...}{.raises: [], tags: [].}
returns whether v is a VNull value as a VBool
func almostEqual(a, b: float; epsilon = 1e-08): bool {...}{.raises: [], tags: [].}

Iterators

iterator keys(df: DataFrame): string {...}{.raises: [], tags: [].}
iterator mpairs(df: var DataFrame): (string, var PersistentVector[Value]) {...}{.raises: [],
    tags: [].}
iterator items(row: Value): Value {...}{.raises: [], tags: [].}
iterator keys(row: Value): string {...}{.raises: [], tags: [].}
iterator pairs(row: Value): tuple[key: string, val: Value] {...}{.raises: [], tags: [].}
Iterator for the elements of row. row has to be a JObject representing a row of a DataFrame
iterator items(df: DataFrame): Value {...}{.raises: [KeyError], tags: [].}
iterator pairs(df: DataFrame): (int, Value) {...}{.raises: [KeyError], tags: [].}
iterator groups(df: DataFrame; order = SortOrder.Ascending): (seq[(string, Value)],
    DataFrame) {...}{.raises: [KeyError, Exception], tags: [].}
yields the subgroups of a grouped DataFrame df and the (key, Value) pairs that were used to create the subgroup. If df has more than one grouping, a subgroup is defined by the pair of the groupings! E.g. mpg.group_by("class", "cyl") will yield all pairs of car ("class", "cyl")! Note: only non empty data frames will be yielded!

Macros

macro toTab(args: varargs[untyped]): untyped
macro `{}`(x: untyped{ident}; y: untyped): untyped
macro fn(x: untyped): untyped

Templates

template `%~`(s: openArray[Value]): seq[Value]
template `[]`(df: DataFrame; idx: int): Value
convenience template around row to access the idx-th row of the DF as a VObject Value.
template `$`(v: Value): string
template `$`(df: DataFrame): string
template seqsToDf(s: varargs[untyped]): untyped
converts an arbitrary number of sequences to a DataFrame or any number of key / value pairs where we have string / seq[T] pairs.
template liftVectorFloatProc(name: untyped; toExport: static bool = true): untyped
Lifts a proc, which takes a seq[float] to act on a PersistentVector[Value] so that it can be used in a formula to act on a whole DF column. toExport can be set to false so that the resulting proc is not exported. This is useful to lift procs only locally (e.g. in a test case etc.)
template liftVectorIntProc(name: untyped; toExport: static bool = true): untyped
Lifts a proc, which takes a seq[int] to act on a PersistentVector[Value] so that it can be used in a formula to act on a whole DF column. toExport can be set to false so that the resulting proc is not exported. This is useful to lift procs only locally (e.g. in a test case etc.)
template liftVectorStringProc(name: untyped; toExport: static bool = true): untyped
Lifts a proc, which takes a seq[string] to act on a PersistentVector[Value] so that it can be used in a formula to act on a whole DF column. toExport can be set to false so that the resulting proc is not exported. This is useful to lift procs only locally (e.g. in a test case etc.)
template liftScalarFloatProc(name: untyped; toExport: static bool = true): untyped
Lifts a proc, which takes a float to act on a Value so that it can be used in a formula to act on an element in a DF. toExport can be set to false so that the resulting proc is not exported. This is useful to lift procs only locally (e.g. in a test case etc.)
template liftScalarIntProc(name: untyped; toExport: static bool = true): untyped
Lifts a proc, which takes a int to act on a Value so that it can be used in a formula to act on an element in a DF. toExport can be set to false so that the resulting proc is not exported. This is useful to lift procs only locally (e.g. in a test case etc.)
template liftScalarStringProc(name: untyped; toExport: static bool = true): untyped
Lifts a proc, which takes a string to act on a Value so that it can be used in a formula to act on an element in a DF. toExport can be set to false so that the resulting proc is not exported. This is useful to lift procs only locally (e.g. in a test case etc.)
template bind_rows(dfs: varargs[DataFrame]; id: string = ""): DataFrame
Overload of bind_rows above, for automatic creation of the id values. Using this proc, the different data frames will just be numbered by their order in the dfs argument and the id column is filled with those values. The values will always appear as strings, even though we use integer numbering. bind_rows combines several data frames row wise (i.e. data frames are stacked on top of one another). If a given column does not exist in one of the data frames, the corresponding rows of the data frame missing it, will be filled with VNull.
template `~`(x: untyped): FormulaNode
template `~`(x, y: untyped): FormulaNode
template `+`(x: FormulaNode; y: untyped): FormulaNode
template `-`(x: FormulaNode; y: untyped): FormulaNode
template `*`(x: FormulaNode; y: untyped): FormulaNode
template `/`(x: FormulaNode; y: untyped): FormulaNode