Usage Arguments Details Author(s) Examples
View source: R/splitFillCatFns.R
1 | spellLength(adm, disch)
|
adm |
Admission dates for (subset of) patient records. |
disch |
Discharge dates for (subset of) patient record. |
Chains of linked discharge and admission dates are made to then determine what the overall first admission and last disscharge times are and then these are substituted in to all of the relevant records.
N Green
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ##---- 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 (adm, disch)
{
for (i in 1:length(adm)) {
dupl <- adm[i] == disch
disch[dupl] <- disch[i]
if (any(dupl, na.rm = TRUE)) {
adm[i] <- adm[dupl] <- min(adm[dupl], na.rm = TRUE)
}
}
list(adm = adm, disch = disch)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.