1(field "another field" 2)
2(f "000001" -2)
3
4(missing? "a field" 23)
5
6(random-value "age")
7(weighted-random-value "000001")
8
9(if (missing? "00000") (random-value "000000") (f "000000"))
10
11(ensure-value "000000")
12(ensure-weighted-value "000000")
13
14(normalize "000001")
15(normalize "length" 8 23)
16
17(z-score "a numeric field")
18(z-score 23)
19
20(field-prop string "00023" name)
21(field-prop numeric "00023" summary missing_count)
22
23(category-count "species" "Iris-versicolor")
24(category-count "species" (f "000004"))
25(bin-count "age" (f "bin-selector"))
26(bin-center "000003" 3)
27(bin-center (field "field-selector") 4)
28
29(let (v (f "age"))
30  (cond (< v 2) "baby"
31        (< v 10) "child"
32        (< v 20) "teenager"
33        "adult"))
34
35(segment-label "000000" "baby" 2 "child" 10 "teenager" 20 "adult")
36(segment-label 0 "1st fourth" "2nd fourth" "3rd fourth" "4th fourth")
37
38(let (max (maximum 0)
39          min (minimum 0)
40          step (/ (- max min) 4))
41  (segment-label 0 "1st fourth" (+ min step)
42                 "2nd fourth" (+ min step step)
43                 "3rd fourth" (+ min step step step)
44                 "4th fourth"))
45
46(contains-items? "000000" "blue" "green" "darkblue")
47
48(<= (percentile "age" 0.5) (f "age") (percentile "age" 0.95))
49
50(within-percentiles? "age" 0.5 0.95)
51
52(percentile-label "000023" "1st" "2nd" "3rd" "4th")
53
54(cond (within-percentiles? "000023" 0 0.25) "1st"
55      (within-percentiles? "000023" 0.25 0.5) "2nd"
56      (within-percentiles? "000023" 0.5 0.75) "3rd"
57      "4th")
58
59(str 1 "hello " (field "a"))
60(str "value_" (+ 3 4) "/" (name "000001"))
61
62(length "abc")
63(length "")
64
65(levenshtein (f 0) "a random string")
66(if (< (levenshtein (f 0) "bluething") 5) "bluething" (f 0))
67
68(occurrences "howdy woman, howdy" "howdy")
69(occurrences "howdy woman" "Man" true)
70(occurrences "howdy man" "Man" true)
71(occurrences "hola, Holas" "hola" true "es")
72
73(md5 "a text")
74(sha1 "a text")
75(sha256 "")
76
77(matches? (field "name") ".*\\sHal\\s.*")
78(matches? (field "name") "(?i).*\\shal\\s.*")
79
80(if (matches? (f "result") (re-quote (f "target"))) "GOOD" "MISS")
81(matches? (f "name") (str "^" (re-quote (f "salutation")) "\\s *$"))
82
83(replace "Almost Pig Latin" "\\b(\\w)(\\w+)\\b" "$2$1ay")
84(replace-first "swap first two words" "(\\w+)(\\s+)(\\w+)" "$3$2$1")
85
86(language "this is an English phrase")
87
88(< (field 0) (field 1))
89(<= (field 0 -1) (field 0) (field 0 1))
90(> (field "date") "07-14-1969")
91(>= 23 (f "000004" -2))
92
93(= "Dante" (field "Author"))
94(= 1300 (field "Year"))
95(= (field "Year" -2) (field "Year" -1) (field "Year"))
96(!= (field "00033" -1) (field "00033" 1))
97
98(and (= 3 (field 1)) (= "meh" (f "a")) (< (f "pregnancies") 5))
99(not true)
100
101(linear-regression 1 1 2 2 3 3 4 4)
102(linear-regression 2.0 3.1 2.3 3.3 24.3 45.2)
103
104(epoch-fields (f "milliseconds"))
105(epoch-year (* 1000 (f "seconds")))
106
107(/ (f "a-datetime-string") 1000)
108(/ (epoch (f "a-datetime-string")) 1000)
109
110(epoch-fields (epoch "1969-14-07T06:00:12"))
111(epoch-hour (epoch "11~22~30" "hh~mm~ss"))
112
113(let (x (+ (window "a" -10 10))
114        a (/ (* x 3) 4.34)
115        y (if (< a 10) "Good" "Bad"))
116  (list x (str (f 10) "-" y) a y))
117
118(list (let (z (f 0)) (* 2 (* z z) (log z)))
119      (let (pi 3.141592653589793 r (f "radius")) (* 4 pi r r)))
120
121(if (< (field "age") 18) "non-adult" "adult")
122
123(if (= "oh" (field "000000")) "OH")
124
125(if (> (field "000001") (mean "000001"))
126  "above average"
127  (if (< (field "000001") (mean "000001"))
128    "below average"
129    "mediocre"))
130
131(cond (> (f "000001") (mean "000001")) "above average"
132      (= (f "000001") (mean "000001")) "below average"
133      "mediocre")
134
135(cond (or (= "a" (f 0)) (= "a+" (f 0))) 1
136      (or (= "b" (f 0)) (= "b+" (f 0))) 0
137      (or (= "c" (f 0)) (= "c+" (f 0))) -1)
138
139(cond (< (f "age") 2) "baby"
140      (and (<= 2 (f "age") 10) (= "F" (f "sex"))) "girl"
141      (and (<= 2 (f "age") 10) (= "M" (f "sex"))) "boy"
142      (< 10 (f "age") 20) "teenager"
143      "adult")
144
145(list (field "age")
146      (field "weight" -1)
147      (population "age"))
148
149(list 1.23
150      (if (< (field "age") 10) "child" "adult")
151      (field 3))
152
153(head (cons x lst))
154(tail (cons x lst))
155
156(count (list (f 1) (f 2)))
157(mode (list a b b c b a c c c))
158(max (list -1 2 -2 0.38))
159(min (list -1.3 2 1))
160(avg (list -1 -2 1 2 0.8 -0.8))
161
162(in 3 (1 2 3 2))
163(in "abc" (1 2 3))
164(in (f "size") ("X" "XXL"))
165
166(< _ 3)
167(+ (f "000001" _) 3)
168(< -18 _ (f 3))
169
170(map (* 2 _) (list (f 0 -1) (f 0) (f 0 1)))
171
172(all-but "id" "000023")
173(fields "000003" 3 "a field" "another" "0002a3b-3")
174
175(all-with-defaults "species" "Iris-versicolor"
176                   "petal-width" 2.8
177                   "000002" 0)
178
179(all-with-numeric-default "median")
180(all-with-numeric-default 0)
181
182(window "000001" -1 2)
183(filter (< _ 99.9) (map (+ 32 (* 1.8 _)) (window "Temp" -2 0)))
184
185(let (now (f "epoch"))
186  (avg (cond-window "temperature" (< (- (f "epoch") now) 240))))
187