This function creates a pairwise correlation plot with annotated correlation
coefficients and optional coloring by a specified variable. The plot can be
interactive or static.
A ggplotly object (if interactive = TRUE) or a ggplot object (if
interactive = FALSE) displaying the pairwise correlation plot with
annotated correlation coefficients and optional coloring by the specified
variable.
Arguments
data
A data frame containing the variables to be plotted.
method
A character string specifying the correlation method. One of
"pearson", "kendall", or "spearman". Default is "pearson".
interactive
A logical value indicating whether the output plot should
be interactive (TRUE) or static (FALSE). Default is TRUE.
col_by
An optional character string specifying the name of the
column in the data frame to be used for coloring points. Default is NULL.