rmAllButOne: Remove all but one patient record

Description Usage Arguments Author(s) Examples

View source: R/removeFns.R

Description

Remove all but one patient record to omit duplicates.

Usage

1
rmAllButOne(ind, subrows, total.data)

Arguments

ind
subrows

row names of subset of rows of total.data on which to apply function.

total.data

Master data.frame of patient records

Author(s)

N Green

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
##---- 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 (ind, subrows, total.data) 
{
    ind.min <- min(which(ind[subrows]))
    ind[subrows] <- FALSE
    ind[subrows[ind.min]] <- TRUE
    total.data <- total.data[ind, ]
    total.data
  }

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