plot_sample_clustering | R Documentation |
This method creates a heatmap based on data stored in a
familiarCollection
object. Features in the heatmap are ordered so that
more similar features appear together.
plot_sample_clustering(
object,
feature_cluster_method = waiver(),
feature_linkage_method = waiver(),
sample_cluster_method = waiver(),
sample_linkage_method = waiver(),
sample_limit = waiver(),
draw = FALSE,
dir_path = NULL,
split_by = NULL,
x_axis_by = NULL,
y_axis_by = NULL,
facet_by = NULL,
facet_wrap_cols = NULL,
ggtheme = NULL,
gradient_palette = NULL,
gradient_palette_range = waiver(),
outcome_palette = NULL,
outcome_palette_range = waiver(),
x_label = waiver(),
x_label_shared = "column",
y_label = waiver(),
y_label_shared = "row",
legend_label = waiver(),
outcome_legend_label = waiver(),
plot_title = waiver(),
plot_sub_title = waiver(),
caption = NULL,
x_range = NULL,
x_n_breaks = 3,
x_breaks = NULL,
y_range = NULL,
y_n_breaks = 3,
y_breaks = NULL,
rotate_x_tick_labels = waiver(),
show_feature_dendrogram = TRUE,
show_sample_dendrogram = TRUE,
show_normalised_data = TRUE,
show_outcome = TRUE,
dendrogram_height = grid::unit(1.5, "cm"),
outcome_height = grid::unit(0.3, "cm"),
evaluation_times = waiver(),
width = waiver(),
height = waiver(),
units = waiver(),
export_collection = FALSE,
verbose = TRUE,
...
)
## S4 method for signature 'ANY'
plot_sample_clustering(
object,
feature_cluster_method = waiver(),
feature_linkage_method = waiver(),
sample_cluster_method = waiver(),
sample_linkage_method = waiver(),
sample_limit = waiver(),
draw = FALSE,
dir_path = NULL,
split_by = NULL,
x_axis_by = NULL,
y_axis_by = NULL,
facet_by = NULL,
facet_wrap_cols = NULL,
ggtheme = NULL,
gradient_palette = NULL,
gradient_palette_range = waiver(),
outcome_palette = NULL,
outcome_palette_range = waiver(),
x_label = waiver(),
x_label_shared = "column",
y_label = waiver(),
y_label_shared = "row",
legend_label = waiver(),
outcome_legend_label = waiver(),
plot_title = waiver(),
plot_sub_title = waiver(),
caption = NULL,
x_range = NULL,
x_n_breaks = 3,
x_breaks = NULL,
y_range = NULL,
y_n_breaks = 3,
y_breaks = NULL,
rotate_x_tick_labels = waiver(),
show_feature_dendrogram = TRUE,
show_sample_dendrogram = TRUE,
show_normalised_data = TRUE,
show_outcome = TRUE,
dendrogram_height = grid::unit(1.5, "cm"),
outcome_height = grid::unit(0.3, "cm"),
evaluation_times = waiver(),
width = waiver(),
height = waiver(),
units = waiver(),
export_collection = FALSE,
verbose = TRUE,
...
)
## S4 method for signature 'familiarCollection'
plot_sample_clustering(
object,
feature_cluster_method = waiver(),
feature_linkage_method = waiver(),
sample_cluster_method = waiver(),
sample_linkage_method = waiver(),
sample_limit = waiver(),
draw = FALSE,
dir_path = NULL,
split_by = NULL,
x_axis_by = NULL,
y_axis_by = NULL,
facet_by = NULL,
facet_wrap_cols = NULL,
ggtheme = NULL,
gradient_palette = NULL,
gradient_palette_range = waiver(),
outcome_palette = NULL,
outcome_palette_range = waiver(),
x_label = waiver(),
x_label_shared = "column",
y_label = waiver(),
y_label_shared = "row",
legend_label = waiver(),
outcome_legend_label = waiver(),
plot_title = waiver(),
plot_sub_title = waiver(),
caption = NULL,
x_range = NULL,
x_n_breaks = 3,
x_breaks = NULL,
y_range = NULL,
y_n_breaks = 3,
y_breaks = NULL,
rotate_x_tick_labels = waiver(),
show_feature_dendrogram = TRUE,
show_sample_dendrogram = TRUE,
show_normalised_data = TRUE,
show_outcome = TRUE,
dendrogram_height = grid::unit(1.5, "cm"),
outcome_height = grid::unit(0.3, "cm"),
evaluation_times = waiver(),
width = waiver(),
height = waiver(),
units = waiver(),
export_collection = FALSE,
verbose = TRUE,
...
)
object |
A |
feature_cluster_method |
The method used to perform clustering. These are
the same methods as for the
If not provided explicitly, this parameter is read from settings used at
creation of the underlying |
feature_linkage_method |
The method used for agglomerative clustering in
If not provided explicitly, this parameter is read from settings used at
creation of the underlying |
sample_cluster_method |
The method used to perform clustering based on
distance between samples. These are the same methods as for the
If not provided explicitly, this parameter is read from settings used at
creation of the underlying |
sample_linkage_method |
The method used for agglomerative clustering in
If not provided explicitly, this parameter is read from settings used at
creation of the underlying |
sample_limit |
(optional) Set the upper limit of the number of samples that are used during evaluation steps. Cannot be less than 20. This setting can be specified per data element by providing a parameter
value in a named list with data elements, e.g.
This parameter can be set for the following data elements:
|
draw |
(optional) Draws the plot if TRUE. |
dir_path |
(optional) Path to the directory where created performance
plots are saved to. Output is saved in the |
split_by |
(optional) Splitting variables. This refers to column names on which datasets are split. A separate figure is created for each split. See details for available variables. |
x_axis_by |
(optional) Variable plotted along the x-axis of a plot.
The variable cannot overlap with variables provided to the |
y_axis_by |
(optional) Variable plotted along the y-axis of a plot.
The variable cannot overlap with variables provided to the |
facet_by |
(optional) Variables used to determine how and if facets of
each figure appear. In case the |
facet_wrap_cols |
(optional) Number of columns to generate when facet wrapping. If NULL, a facet grid is produced instead. |
ggtheme |
(optional) |
gradient_palette |
(optional) Sequential or divergent palette used to colour the similarity or distance between features in a heatmap. |
gradient_palette_range |
(optional) Numerical range used to span the
gradient. This should be a range of two values, e.g. |
outcome_palette |
(optional) Sequential ( |
outcome_palette_range |
(optional) Numerical range used to span the
gradient of numeric ( |
x_label |
(optional) Label to provide to the x-axis. If NULL, no label is shown. |
x_label_shared |
(optional) Sharing of x-axis labels between facets. One of three values:
|
y_label |
(optional) Label to provide to the y-axis. If NULL, no label is shown. |
y_label_shared |
(optional) Sharing of y-axis labels between facets. One of three values:
|
legend_label |
(optional) Label to provide to the legend. If NULL, the legend will not have a name. |
outcome_legend_label |
(optional) Label to provide to the legend for
outcome data. If NULL, the legend will not have a name. By default,
|
plot_title |
(optional) Label to provide as figure title. If NULL, no title is shown. |
plot_sub_title |
(optional) Label to provide as figure subtitle. If NULL, no subtitle is shown. |
caption |
(optional) Label to provide as figure caption. If NULL, no caption is shown. |
x_range |
(optional) Value range for the x-axis. |
x_n_breaks |
(optional) Number of breaks to show on the x-axis of the
plot. |
x_breaks |
(optional) Break points on the x-axis of the plot. |
y_range |
(optional) Value range for the y-axis. |
y_n_breaks |
(optional) Number of breaks to show on the y-axis of the
plot. |
y_breaks |
(optional) Break points on the y-axis of the plot. |
rotate_x_tick_labels |
(optional) Rotate tick labels on the x-axis by
90 degrees. Defaults to |
show_feature_dendrogram |
(optional) Show feature dendrogram around
the main panel. Can be If a position is specified, it should be appropriate with regard to the
A dendrogram can only be drawn from cluster methods that produce
dendograms, such as |
show_sample_dendrogram |
(optional) Show sample dendrogram around the
main panel. Can be If a position is specified, it should be appropriate with regard to the
A dendrogram can only be drawn from cluster methods that produce
dendograms, such as |
show_normalised_data |
(optional) Flag that determines whether the
data shown in the main heatmap is normalised using the same settings as
within the analysis ( Categorial variables are plotted to span 90% of the entire numerical value range, i.e. the levels of categorical variables with 2 levels are represented at 5% and 95% of the range, with 3 levels at 5%, 50%, and 95%, etc. |
show_outcome |
(optional) Show outcome column(s) or row(s) in the
graph. Can be If a position is specified, it should be appropriate with regard to the
The outcome data will be drawn between the main panel and the sample dendrogram (if any). |
dendrogram_height |
(optional) Height of the dendrogram. The height is
1.5 cm by default. Height is expected to be grid unit (see |
outcome_height |
(optional) Height of an outcome data column/row. The
height is 0.3 cm by default. Height is expected to be a grid unit (see
|
evaluation_times |
(optional) Times at which the event status of
time-to-event survival outcomes are determined. Only used for |
width |
(optional) Width of the plot. A default value is derived from the number of facets. |
height |
(optional) Height of the plot. A default value is derived from the number of features and the number of facets. |
units |
(optional) Plot size unit. Either |
export_collection |
(optional) Exports the collection if TRUE. |
verbose |
Flag to indicate whether feedback should be provided for the plotting. |
... |
Arguments passed on to
|
This function generates area under the ROC curve plots.
Available splitting variables are: fs_method
, learner
, and data_set
.
By default, the data is split by fs_method
and learner
and data_set
,
since the number of samples will typically differ between data sets, even
for the same feature selection method and learner.
The x_axis_by
and y_axis_by
arguments determine what data are shown
along which axis. Each argument takes one of feature
and sample
, and
both arguments should be unique. By default, features are shown along the
x-axis and samples along the y-axis.
Note that similarity is determined based on the underlying data. Hence the ordering of features may differ between facets, and tick labels are maintained for each panel.
Available palettes for gradient_palette
are those listed by
grDevices::palette.pals()
(requires R >= 4.0.0), grDevices::hcl.pals()
(requires R >= 3.6.0) and rainbow
, heat.colors
, terrain.colors
,
topo.colors
and cm.colors
, which correspond to the palettes of the same
name in grDevices
. If not specified, a default palette based on palettes
in Tableau are used. You may also specify your own palette by using colour
names listed by grDevices::colors()
or through hexadecimal RGB strings.
Labeling methods such as set_fs_method_names
or set_data_set_names
can
be applied to the familiarCollection
object to update labels, and order
the output in the figure.
NULL
or list of plot objects, if dir_path
is NULL
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.