Skip to main content
Skip table of contents

applyFilter

Apply a filter on the current data.

Usage

R
applyFilter(filter, name = "")

Arguments

filter

(list< list< action = "headerName-comparator-value" > > or "complement") filter definition.
Existing actions are "selectLines", "selectIds", "removeLines" and "removeIds". First vector level is for set unions, the second one for set intersection.
It is possible to give only a list of actions if there is only no high-level union.

name

(character) [optional] created data set name. If not defined, the default name is "currentDataSet_filtered".

Details

The possible actions are line selection (selectLines), line removal (removeLines), Ids selection (selectIds) or removal (removeIds).
The selection is a string containing the header name, a comparison operator and a value
selection = "headerName*-comparator**-value" (ex: "id=='100'", "WEIGHT<70", "SEX!='M'")
Notice that :
- The headerName corresponds to the data set header or one of the header aliases defined in MONOLIX software preferences
- The comparator possibilities are "==", "!=" for all types of value and "<=", "<", ">=", ">" only for numerical types

Syntax:
* apply a simple filter:
applyFilter( filter = list(act = sel)), e.g. applyFilter( filter = list(removeIds = "WEIGHT<50"))
=> apply a filter with the action act on the selection sel. In this example, we apply a filter that removes all subjects with a weight less than 50.
* apply a filter with several concurrent conditions, i.e AND condition:
applyFilter( list(act1 = sel1, act2 = sel2)), e.g. applyFilter( filter = list(removeIds = "WEIGHT<50", removeIds = " AGE<20"))
=> apply a filter with both the action act1 on sel1 AND the action act2 on sel2. In this example, we apply a filter that removes all subjects with a weight less than 50 and an age less than 20. It corresponds to the intersecton of the subjects with a weight less than 50 and the subjects with an age less than 20.
* apply a filter with several non-concurrent conditions, i.e OR condition:
applyFilter(filter = list(list(act1 = sel1), list(act2 = sel2)) ), e.g. applyFilter( filter = list(list(removeIds = "WEIGHT<50"),list(removeIds = " AGE<20")))
=> apply a filter with the action act1 on sel1 OR the action act2 on sel2. In this example, we apply a filter that removes all subjects with a weight less than 50 and an age less than 20.
It corresponds to the union of the subjects with a weight less than 50 and the subjects with an age less than 20.
* It is possible to have any combination:
applyFilter(filter = list(list(act1 = sel1), list(act2 = sel2, act3 = sel3)) ) <=> act1,sel1 OR ( act2,sel2 AND act3,sel3 )
* It is possible to apply the complement of an existing filter:
applyFilter(filter = "complement")

Examples

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.