splitByOrg: Stratify the patient sample by organism type

Description Usage Arguments Author(s) See Also Examples

View source: R/splitFillCatFns.R

Description

Deprecated by the more general splitByGroup.

Usage

1
splitByOrg(total.data, survData.all)

Arguments

total.data

The complete combined raw data.

survData.all

The complete survival data format array with multiple same-patient in-hospital infection records removed.

Author(s)

N Green

See Also

splitByGroup

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (total.data, survData.all) 
{
    survDataByGroup <- list()
    namesGroup <- unique(total.data$lab_group[!is.na(total.data$lab_group)])
    for (name in namesGroup) {
        groupRows <- total.data$lab_group %in% c(name, NA)
        uniqueGroupRows <- rmOrganism(total.data[groupRows, ])
        survDataByGroup[[name]] <- survData.all[groupRows, ][uniqueGroupRows, 
            ]
    }
    gram <- c(-1, 1)
    for (i in seq_along(gram)) {
        groupRows <- total.data$Gram %in% c(gram[i], NA)
        uniqueGroupRows <- rmOrganism(total.data[groupRows, ])
        survDataByGroup[[as.character(gram[i])]] <- survData.all[groupRows, 
            ][uniqueGroupRows, ]
    }
    survDataByGroup
  }

n8thangreen/HESmanip documentation built on March 21, 2020, 12:20 a.m.