interactions {tame} | R Documentation |
Timing and ATC pattern interactions
Description
The function interactions()
calculates the frequencies of distinct timing
and ATC combinations within clusters.
Usage
interactions(
clustering,
only = NULL,
clusters = NULL,
atc_groups = data.frame(regex = paste0("^", LETTERS), atc_groups = LETTERS),
additional_data = NULL,
...
)
Arguments
only |
<data-masking > Expressions that
return a logical value, and are defined in terms of the variables in
object and/or additional_data .
The default NULL selects all clusterings in object .
|
clusters |
<tidy-select > An unquoted
expression naming the cluster or clusters in object one wants to
see summaries of. Names can be used as if they were positions in the data
frame, so expressions like I:IV can be used to select a range of clusters.
The default NULL selects all clusters in the chosen clusterings of
object .
|
atc_groups |
A data.frame specifying the ATC groups to summaries by. The
data.frame must have two columns:
As a standard the anatomical level (first level) of the ATC codes is used.
|
additional_data |
A data frame with additional data that may be
(left-)joined onto the parameters in object . This is often
used in conjuction with only to select specific clusterings based on
additional_data .
|
... |
Additional arguments passed to the internal summary function.
-
cluster_wise an option in the medications() function.
-
m an option in the medications() function. A numeric restricting the
number of distinct ATC codes plotted within each cluster. That is, the
(at most) m most frequent ATC codes within that cluster is given a
color.
-
q an option in the medications() function. A numeric between 0 and 1
restricting the minimal ATC codes frequency displayed within each
cluster.
-
count_grouper an option in the amounts() function. A function for
grouping counts. As a standard it groups counts as 1 medication, 2
medications, and 3+ medications.
-
atc_groups A data.frame specifying the ATC groups to summaries by. The
data.frame must have two columns: (1) regex giving regular expressions
specifying the wanted ATC groups and (2) atc_groups the name of this
ATC grouping. As a standard the anatomical level (first level) of the ATC
codes is used.
|
Details
interactions()
calculates both the number of people with unique timing
trajectory and ATC group, as given by atc_groups
, in each cluster.
Value
interactions()
returns a data frame of class summary.medic.interactions
-
cluster_name
the name of the clustering.
-
cluster
the cluster name.
-
n
the number of people in the cluster.
-
atc_group
ATC groups as specified by the atc_groups
input.
-
timing variable a unique timing pattern in cluster
and atc_group
.
-
n_interaction
number of people in this cluster with this timing and atc
group combination.
[Package
tame version 0.0.1
Index]