createFilter
[Monolix - PKanalix] Create filter
Create a new filtered data set by applying a filter on an existing one and/or complementing it.
Usage
createFilter(filter, name = "", origin = "")
Arguments
- filter
(list< list< action = "headerName-comparator-value" > > or "complement") [optional] 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".
- origin
(character) [optional] name of the data set to be filtered. The current one is used by default.
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:
* create a simple filter:
createFilter( filter = list(act = sel)), e.g. createFilter( filter = list(removeIds = "WEIGHT<50"))
=> create a filter with the action act on the selection sel. In this example, we create a filter that removes all subjects with a weight less than 50.
* create a filter with several concurrent conditions, i.e AND condition:
createFilter( list(act1 = sel1, act2 = sel2)), e.g. createFilter( filter = list(removeIds = "WEIGHT<50", removeIds = " AGE<20"))
=> create a filter with both the action act1 on sel1 AND the action act2 on sel2. In this example, we create 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.
* create a filter with several non-concurrent conditions, i.e OR condition:
createFilter(filter = list(list(act1 = sel1), list(act2 = sel2)) ), e.g. createFilter( filter = list(list(removeIds = "WEIGHT<50"),list(removeIds = " AGE<20")))
=> create a filter with the action act1 on sel1 OR the action act2 on sel2. In this example, we create 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 combinaison:
createFilter(filter = list(list(act1 = sel1), list(act2 = sel2, act3 = sel3)) ) <=> act1,sel1 OR ( act2,sel2 AND act3,sel3 )
* It is possible to create the complement of an existing filter:
createFilter(filter = "complement")