Description Usage Arguments Author(s) See Also Examples
Group patients against specified groupings using change in factor labels, over all groups.
1 |
lookup |
Look-up table of codes by group. |
scheme |
Denotes which type of codes to use e.g. ICD10 or OPCS. |
data |
Patient data on which to apply the grouping. |
N Green
my_recode
, ~~~
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ##---- 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 (lookup, scheme, data)
{
lookup.list <- as.list(unstack(lookup[lookup$Scheme == scheme,
c("Code", "Group")], Code ~ Group))
y <- apply(data, 2, function(x) my_recode(x, lookup.list))
list.names <- names(lookup.list)
res <- NULL
for (i in list.names) {
res <- cbind(res, apply(y, 1, function(x) any(x == i)))
}
colnames(res) <- list.names
res
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.