getSubjSex {sendigR} | R Documentation |
Extract the set of animals of the specified sex - or just add the sex of each animal.
Description
Returns a data table with the set of animals included in the
animalList
of the sex specified in the sexFilter
.
If the sexFilter
is empty (null, na or empty string) - all rows from
animalList
are returned with the an additional populated SEX column.
Usage
getSubjSex(
dbToken,
animalList,
sexFilter = NULL,
inclUncertain = FALSE,
noFilterReportUncertain = TRUE
)
Arguments
dbToken |
Mandatory |
animalList |
Mandatory, data.table. |
sexFilter |
Optional, character. |
inclUncertain |
Mandatory, boolean. |
noFilterReportUncertain |
Mandatory, boolean. |
Details
The sex value is decided from the DM.SEX variable.
The comparison of DM.SEX with the given value(s) in sexFilter
is done
case-insensitive.
If input parameter inclUncertain=TRUE
, uncertain animals are included
in the output set. These uncertain situations are identified and reported (in
column UNCERTAIN_MSG):
The DM.SEX value is empty or invalid (not CT value - CDISC codelist SEX - case insensitive comparison)
The same checks are performed and reported in column NOT_VALID_MSG if
sexFilter
is empty and noFilterReportUncertain=TRUE
.
Value
The function returns a data.table with columns:
STUDYID (character)
Additional columns contained in the
animalList
tableSEX (character)
UNCERTAIN_MSG (character)
Included when parameterinclUncertain=TRUE
.
In case the sex cannot be confidently matched during the filtering of data, the column contains an indication of the reason.
Is NA for rows where SEX can be confidently matched.
A non-empty UNCERTAIN_MSG value generated by this function is merged with non-empty UNCERTAIN_MSG values which may exist in the input set of animals specified inanimalList
- separated by '|'.NOT_VALID_MSG (character)
Included when parameternoFilterReportUncertain=TRUE
.
In case the sex cannot be confidently decided, the column contains an indication of the reason.
Is NA for rows where sex can be confidently decided.
A non-empty NOT_VALID_MSG value generated by this function is merged with non-empty NOT_VALID_MSG values which may exist in the input set of animalsanimalList
- separated by '|'.
Examples
## Not run:
getSubjSex(myDbToken, controlAnimals, 'M')
## End(Not run)