plot_summary | R Documentation |
This function plots the summary of the clustering results.
plot_summary(object, ...)
## S3 method for class 'medic'
plot_summary(object, only = NULL, clusters = NULL, additional_data = NULL, ...)
## S3 method for class 'summary.medic'
plot_summary(
object,
n_breaks = 5,
plot_individual = FALSE,
labels = FALSE,
alpha_individual = 0.1,
label_y_value = 0.1,
...
)
object |
The object containing the summary data. |
... |
Additional arguments passed to the plotting functions. |
only |
< The default |
clusters |
< The default |
additional_data |
A data frame with additional data that may be
(left-)joined onto the |
n_breaks |
The number of breaks for the time scale. |
plot_individual |
Logical value indicating whether to plot individual trajectories. |
labels |
Logical value indicating whether to include labels. |
alpha_individual |
The alpha value for the individual trajectories. |
label_y_value |
A number between 0 and 1 that defines the height of the label text hight. |
A ggplot object.
summary
plot_cluster_frequency
plot_medication_frequency
plot_comedication_count
plot_timing_trajectory
plot_timing_atc_group
clust <- medic(
complications,
id = id,
atc = atc,
k = 3,
timing = first_trimester:third_trimester
)
clust |> plot_summary()
clust |> summary() |> plot_summary()
# If the clustering object contains more than one clustering, it is necessary
# to filter the clustering, as only one clustering can be plotted at a time.
clust <- medic(
complications,
id = id,
atc = atc,
k = 3:5,
timing = first_trimester:third_trimester
)
clust |> plot_summary(only = k == 4)
clust |> summary(only = k == 4) |> plot_summary()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.