File tree 1 file changed +5
-5
lines changed
modules/incanter-core/src/incanter
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 197
197
returns all columns by default, can pass a column index or sequence of column indices
198
198
:except-rows (default nil) can pass a row index or sequence of row indices to exclude
199
199
:except-cols (default nil) can pass a column index or sequence of column indices to exclude
200
- :filter (default nil)
200
+ :filter-fn (default nil)
201
201
a function can be provided to filter the rows of the matrix
202
202
203
203
Examples:
215
215
(sel iris :except-cols 1) ; all columns except the second
216
216
217
217
;; return only the first 10 even rows
218
- (sel iris :rows (range 10) :filter #(even? (int (nth % 0))))
218
+ (sel iris :rows (range 10) :filter-fn #(even? (int (nth % 0))))
219
219
;; select rows where distance (third column) is greater than 50
220
220
(sel iris :filter #(> (nth % 2) 4))
221
221
1175
1175
]
1176
1176
(cond
1177
1177
cols
1178
- (map #(sel mat :cols cols :filter (filter-fn %)) groups)
1178
+ (map #(sel mat :cols cols :filter-fn (filter-fn %)) groups)
1179
1179
except-cols
1180
- (map #(sel mat :except-cols except-cols :filter (filter-fn %)) groups)
1180
+ (map #(sel mat :except-cols except-cols :filter-fn (filter-fn %)) groups)
1181
1181
:else
1182
- (map #(sel mat :filter (filter-fn %)) groups)))))
1182
+ (map #(sel mat :filter-fn (filter-fn %)) groups)))))
1183
1183
1184
1184
1185
1185
You can’t perform that action at this time.
0 commit comments