corrPairs.Rd
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.
corrPairs(
data,
method = c("pearson", "kendall", "spearman"),
interactive = TRUE,
col_by = NULL
)
A data frame containing the variables to be plotted.
A character string specifying the correlation method. One of "pearson", "kendall", or "spearman". Default is "pearson".
A logical value indicating whether the output plot should be interactive (TRUE) or static (FALSE). Default is TRUE.
An optional character string specifying the name of the column in the data frame to be used for coloring points. Default is NULL.
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.
corrPairs(data = mtcars[,1:4],
method = "pearson",
interactive = TRUE,
col_by = "cyl")