Equivalent of .Filter() in Insight Maker when using arguments x and key in the filter function
Usage
filter_IM(y, condition_func)
Arguments
- y
Named vector
- condition_func
Function which takes arguments x and key and outputs a boolean value
Value
Vector with elements which meet condition_func
See also
Other custom:
%REM%()
,
contains_IM()
,
expit()
,
indexof()
,
length_IM()
,
logistic()
,
logit()
,
mod()
,
rbool()
,
rdist()
,
rem()
,
round_IM()
,
shuffle()
,
substr_i()
Examples
filter_IM(c(a = 1, b = 2, c = 3), function(x, key) {
x > 1
})
#> b c
#> 2 3
# b c
# 2 3
filter_IM(c(a = 1, b = 2, c = 3), function(x, key) {
x > 1 & key != "b"
})
#> c
#> 3
# c
# 3